Class jToolkit.Gui.CommandJButton
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jToolkit.Gui.CommandJButton

Object
   |
   +----Component
           |
           +----Container
                   |
                   +----JComponent
                           |
                           +----AbstractButton
                                   |
                                   +----JButton
                                           |
                                           +----jToolkit.Gui.CommandJButton

public class CommandJButton
extends JButton
implements ActionListener
The CommandJButton extends the normal (Swing-)JButton with an automatic command call when the button is pressed. Usage: class FooClass extends JPanel implements CommandButtonListener { final int IDOK = 1; final int IDCANCEL = 2; void Constructor () { CommandJButton ok = new CommandJButton ("OK", this, IDOK); CommandJButton cancel = new CommandJButton ("Cancel", this, IDCANCEL); add (ok); add (cancel); } void ButtonClicked (int ID); { if (ID == IDOK) doOK(); // OK pressed if (ID == IDCANCEL) doCancel(); // Cancel pres } }

Author:
Andreas Schroeter
Since:
30.03.

Constructor Index

 o jToolkit.Gui.CommandJButton(String, CommandButtonListener, int)
 o jToolkit.Gui.CommandJButton(CommandButtonListener, int)
 o jToolkit.Gui.CommandJButton(String, Icon, CommandButtonListener, int)
 o jToolkit.Gui.CommandJButton(Icon, CommandButtonListener, int)

Method Index

 o actionPerformed(ActionEvent)

Constructors

 o CommandJButton
public CommandJButton(String label,
                      CommandButtonListener cbl,
                      int ID)
 o CommandJButton
public CommandJButton(CommandButtonListener cbl,
                      int ID)
 o CommandJButton
public CommandJButton(String text,
                      Icon icon,
                      CommandButtonListener cbl,
                      int ID)
 o CommandJButton
public CommandJButton(Icon icon,
                      CommandButtonListener cbl,
                      int ID)

Methods

 o actionPerformed
public void actionPerformed(ActionEvent e)

All Packages  Class Hierarchy  This Package  Previous  Next  Index