void () { myNextLabel.setVisible(myTexts.size() > 1); if (!myTexts.isEmpty()) { Item item = myTexts.get(myCurrentItem.get() % myTexts.size()); item.setForLabel(myTextPanel); } else { myTextPanel.setText(""); myTextPanel.setIcon(null); myTextPanel.setForeground(myForeground); } myComponent.revalidate(); myComponent.repaint(); }