All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.JButtonModel

java.lang.Object
   |
   +----com.sun.java.swing.JButtonModel

public class JButtonModel
extends Object
implements ButtonModel

Variable Index

 o actionCommand
 o actionListener
 o ARMED
Indicates if the button can be selected or not by the an input device (such as a mouse pointer).
 o changeEvent
Only one ChangeEvent is needed per button model instance since the event's only state is the source property.
 o changeListener
 o DISABLED
Indicates the button is currently disabled and can't be changed.
 o group
 o itemListener
 o keyAccelerator
 o PRESSED
Indicates partial commitment towards choosing the button.
 o ROLLOVER
Indicates that the mouse is over the button.
 o SELECTED
Indicates if the button has been selected.
 o stateMask

Constructor Index

 o JButtonModel()
Constructs a JButtonModel

Method Index

 o addActionListener(ActionListener)
adds an ActionListener to the button
 o addChangeListener(ChangeListener)
adds a ChangeListener to the button
 o addItemListener(ItemListener)
adds an ItemListener to the button
 o getActionCommand()
Returns the action command for this button.
 o getKeyAccelerator()
 o getSelectedObjects()
 o isArmed()
Checks if the button is armed.
 o isDisabled()
Checks if the button is disabled.
 o isPressed()
Checks if the button is pressed.
 o isRollover()
Checks if the button is rolled over.
 o isSelected()
Checks if the button is selected.
 o removeActionListener(ActionListener)
removes an ActionListener from the button
 o removeChangeListener(ChangeListener)
removes a ChangeListener from the button
 o removeItemListener(ItemListener)
removes an ItemListener from the button
 o setActionCommand(String)
Sets the actionCommand that gets sent when the putton is pressed.
 o setArmed(boolean)
Sets the button to the armed state
 o setDisabled(boolean)
Sets the button to be enabled or disabled state
 o setGroup(ButtonGroup)
 o setKeyAccelerator(char)
 o setPressed(boolean)
Sets the button to pressed state
 o setRollover(boolean)
Sets the button to the rollover state
 o setSelected(boolean)
Sets the selected state of the button.

Variables

 o stateMask
 protected int stateMask
 o actionCommand
 protected String actionCommand
 o group
 protected ButtonGroup group
 o actionListener
 protected ActionListener actionListener
 o changeListener
 protected ChangeListener changeListener
 o itemListener
 protected ItemListener itemListener
 o keyAccelerator
 protected char keyAccelerator
 o changeEvent
 protected ChangeEvent changeEvent
Only one ChangeEvent is needed per button model instance since the event's only state is the source property. The source of events generated is always "this".

 o ARMED
 public static final int ARMED
Indicates if the button can be selected or not by the an input device (such as a mouse pointer).

 o SELECTED
 public static final int SELECTED
Indicates if the button has been selected. Only needed for certain types of buttons - such as RadioButton or Checkbox.

 o PRESSED
 public static final int PRESSED
Indicates partial commitment towards choosing the button.

 o DISABLED
 public static final int DISABLED
Indicates the button is currently disabled and can't be changed.

 o ROLLOVER
 public static final int ROLLOVER
Indicates that the mouse is over the button.

Constructors

 o JButtonModel
 public JButtonModel()
Constructs a JButtonModel

Methods

 o setActionCommand
 public void setActionCommand(String actionCommand)
Sets the actionCommand that gets sent when the putton is pressed.

 o getActionCommand
 public String getActionCommand()
Returns the action command for this button.

 o isArmed
 public boolean isArmed()
Checks if the button is armed.

 o isSelected
 public boolean isSelected()
Checks if the button is selected.

 o isDisabled
 public boolean isDisabled()
Checks if the button is disabled.

 o isPressed
 public boolean isPressed()
Checks if the button is pressed.

 o isRollover
 public boolean isRollover()
Checks if the button is rolled over.

 o setArmed
 public void setArmed(boolean b)
Sets the button to the armed state

 o setDisabled
 public void setDisabled(boolean b)
Sets the button to be enabled or disabled state

 o setSelected
 public void setSelected(boolean b)
Sets the selected state of the button.

Parameters:
b - true selects the toggle button, false deselects the toggle button.
 o setPressed
 public void setPressed(boolean b)
Sets the button to pressed state

 o setRollover
 public void setRollover(boolean b)
Sets the button to the rollover state

 o setKeyAccelerator
 public void setKeyAccelerator(char aKey)
 o getKeyAccelerator
 public char getKeyAccelerator()
 o addChangeListener
 public void addChangeListener(ChangeListener l)
adds a ChangeListener to the button

 o removeChangeListener
 public void removeChangeListener(ChangeListener l)
removes a ChangeListener from the button

 o addActionListener
 public void addActionListener(ActionListener l)
adds an ActionListener to the button

 o removeActionListener
 public void removeActionListener(ActionListener l)
removes an ActionListener from the button

 o addItemListener
 public void addItemListener(ItemListener l)
adds an ItemListener to the button

 o removeItemListener
 public void removeItemListener(ItemListener l)
removes an ItemListener from the button

 o getSelectedObjects
 public Object[] getSelectedObjects()
 o setGroup
 public void setGroup(ButtonGroup group)

All Packages  Class Hierarchy  This Package  Previous  Next  Index