public void setIcon(String command, ImageIcon icon) { JButton b = (JButton) buttons.get(command); if (b != null) { b.setIcon(icon); b.revalidate(); setButtonsSize(); } }
public void setShowNames(boolean b) { if (shownames == b) return; shownames = b; Iterator it = buttons.keySet().iterator(); while (it.hasNext()) { String command = (String) it.next(); JButton button = (JButton) buttons.get(command); button.setText((shownames) ? command : ""); button.setToolTipText((!shownames) ? command : ""); } setButtonsSize(); }
public void setEnabled(String command, boolean enabled) { JButton b = (JButton) buttons.get(command); if (b != null) b.setEnabled(enabled); }