コード例 #1
0
 public void actionPerformed(final ActionEvent ae) {
   System.out.println("About performed.");
   JOptionPane.showMessageDialog(
       frame,
       "SharedActions illustrates one way of handling\n"
           + "AbstractActions in a Swing application.\n\n"
           + "The author can be reached at [email protected]\n\n",
       "About SharedActions",
       JOptionPane.INFORMATION_MESSAGE);
   SharedActions.setActionEnabled(SharedActions.ACTION1_KEY, true);
   SharedActions.setActionEnabled(SharedActions.ACTION2_KEY, true);
   SharedActions.setActionSelected(SharedActions.ACTION3_KEY, true);
   SharedActions.setActionSelected(SharedActions.ACTION4_KEY, true);
 }
コード例 #2
0
    public void actionPerformed(final ActionEvent ae) {
      AbstractButton btn = (AbstractButton) ae.getSource();

      System.out.println("Action 3 performed.");
      SharedActions.setActionSelected(SharedActions.ACTION4_KEY, btn.isSelected());
    }