コード例 #1
0
 public void setIcon(String command, ImageIcon icon) {
   JButton b = (JButton) buttons.get(command);
   if (b != null) {
     b.setIcon(icon);
     b.revalidate();
     setButtonsSize();
   }
 }
コード例 #2
0
 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();
 }
コード例 #3
0
 public void setEnabled(String command, boolean enabled) {
   JButton b = (JButton) buttons.get(command);
   if (b != null) b.setEnabled(enabled);
 }