Пример #1
0
 public void setDeck(Deck d) {
   deck = d;
   cardList = deck.getList();
   removeAll();
   createGUI();
   setVisible(false);
   setVisible(true);
 }
Пример #2
0
 public CardEditor() {
   String name = null;
   while (name == null) {
     name = JOptionPane.showInputDialog("Deck Name:");
   }
   deck = new Deck(name);
   cardList = deck.getList();
   createGUI();
 }
Пример #3
0
 public CardEditor(Deck deck) {
   this.deck = deck;
   cardList = deck.getList();
   createGUI();
 }
Пример #4
0
 public void cleanUp() {
   if (cardList.getSelectedIndex() != -1) {
     deck.getCard(cardList.getSelectedIndex()).setSide(1, side1.getText());
     deck.getCard(cardList.getSelectedIndex()).setSide(2, side2.getText());
   }
 }