示例#1
0
  /*
   * Remove the selected card in JTable from the Deck
   * Update the table model
   *
   * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
   */
  @Override
  public void actionPerformed(ActionEvent e) {

    if (deckView.getRow() > -1) {

      Card selectedCard = deck.getCards().get(deckView.getRow());
      deck.removeFromDeck(selectedCard);

      tableModel = new TableModel(deck);
    }
  }
示例#2
0
 @Test
 public void deckTest() {
   Deck d = new Deck();
   NewCard c = d.giveCard(0);
   assertEquals(c.getRank(), "2");
 }