public void setIcon(String command, ImageIcon icon) { JButton b = (JButton) buttons.get(command); if (b != null) { b.setIcon(icon); b.revalidate(); setButtonsSize(); } }