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(); }