void sellButton_actionPerformed(ActionEvent e) {

        int n = bottomTable.getSelectedRow();
        if (n != -1) {
            Card c = bottomModel.rowToCard(n);
            bottomModel.removeCard(c);

            topModel.addCard(c);
            topModel.resort();

            //bottomModel.removeCard(c);
            questData.addCardToShopList(c);

            long price = (long) (multi * c.getValue());
            if (questData.getWin() <= 50 && price > 500)
                price = 500;

            questData.addCredits(price);
            questData.removeCard(c);

            creditsLabel.setText("Total credits: " + questData.getCredits());

            //remove sold cards from all decks:
            java.util.List<String> deckNames = questData.getDeckNames();
            for (String deckName : deckNames) {
                Deck deck = questData.getDeck(deckName);
                if (deck.getMain().contains(c.getName())) {
                    //count occurences:
                    int cardPoolCount = 0;
                    java.util.List<String> cpList = questData.getCards();
                    while (cpList.contains(c.getName())) {
                        cpList.remove(cpList.indexOf(c.getName()));
                        cardPoolCount++;
                    }
                    if (cardPoolCount < 4)
                        deck.removeMain(c);
                }
            }

            //3 conditions" 0 cards left, select the same row, select next row
            int size = bottomModel.getRowCount();
            if (size != 0) {
                if (size == n) n--;
                bottomTable.addRowSelectionInterval(n, n);
            }
        }//if(valid row)
    }//sellButton_actionPerformed