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.
-
jToolkit.Gui.CommandJButton(String, CommandButtonListener, int)
-
-
jToolkit.Gui.CommandJButton(CommandButtonListener, int)
-
-
jToolkit.Gui.CommandJButton(String, Icon, CommandButtonListener, int)
-
-
jToolkit.Gui.CommandJButton(Icon, CommandButtonListener, int)
-
-
actionPerformed(ActionEvent)
-
CommandJButton
public CommandJButton(String label,
CommandButtonListener cbl,
int ID)
CommandJButton
public CommandJButton(CommandButtonListener cbl,
int ID)
CommandJButton
public CommandJButton(String text,
Icon icon,
CommandButtonListener cbl,
int ID)
CommandJButton
public CommandJButton(Icon icon,
CommandButtonListener cbl,
int ID)
actionPerformed
public void actionPerformed(ActionEvent e)
All Packages Class Hierarchy This Package Previous Next Index