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