public void addGenericItem(Object o) { checkBottomCard(); SylladexCard card = m.getNextEmptyCard(); card.setItem(o); stack.addFirst(card); JLabel icon = m.getIconLabelFromObject(o); icons.add(0, icon); m.setIcons(icons); card.setIcon(icon); arrangeCards(); }
@Override public void prepare() { for (String string : items) { if (!string.equals("")) { if (m.getNextEmptyCard() == null) { m.addCard(); } SylladexCard card = m.getNextEmptyCard(); Object o = m.getItem(string); card.setItem(o); stack.addLast(card); JLabel icon = m.getIconLabelFromObject(o); icons.add(icon); m.setIcons(icons); card.setIcon(icon); arrangeCards(); } } }