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
-
actionCommand
-
-
actionListener
-
-
ARMED
- Indicates if the button can be selected or not by
the an input device (such as a mouse pointer).
-
changeEvent
- Only one ChangeEvent is needed per button model instance since the
event's only state is the source property.
-
changeListener
-
-
DISABLED
- Indicates the button is currently disabled and
can't be changed.
-
group
-
-
itemListener
-
-
keyAccelerator
-
-
PRESSED
- Indicates partial commitment towards choosing the
button.
-
ROLLOVER
- Indicates that the mouse is over the button.
-
SELECTED
- Indicates if the button has been selected.
-
stateMask
-
-
JButtonModel()
- Constructs a JButtonModel
-
addActionListener(ActionListener)
- adds an ActionListener to the button
-
addChangeListener(ChangeListener)
- adds a ChangeListener to the button
-
addItemListener(ItemListener)
- adds an ItemListener to the button
-
getActionCommand()
- Returns the action command for this button.
-
getKeyAccelerator()
-
-
getSelectedObjects()
-
-
isArmed()
- Checks if the button is armed.
-
isDisabled()
- Checks if the button is disabled.
-
isPressed()
- Checks if the button is pressed.
-
isRollover()
- Checks if the button is rolled over.
-
isSelected()
- Checks if the button is selected.
-
removeActionListener(ActionListener)
- removes an ActionListener from the button
-
removeChangeListener(ChangeListener)
- removes a ChangeListener from the button
-
removeItemListener(ItemListener)
- removes an ItemListener from the button
-
setActionCommand(String)
- Sets the actionCommand that gets sent when the putton is pressed.
-
setArmed(boolean)
- Sets the button to the armed state
-
setDisabled(boolean)
- Sets the button to be enabled or disabled state
-
setGroup(ButtonGroup)
-
-
setKeyAccelerator(char)
-
-
setPressed(boolean)
- Sets the button to pressed state
-
setRollover(boolean)
- Sets the button to the rollover state
-
setSelected(boolean)
- Sets the selected state of the button.
stateMask
protected int stateMask
actionCommand
protected String actionCommand
group
protected ButtonGroup group
actionListener
protected ActionListener actionListener
changeListener
protected ChangeListener changeListener
itemListener
protected ItemListener itemListener
keyAccelerator
protected char keyAccelerator
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".
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).
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.
PRESSED
public static final int PRESSED
- Indicates partial commitment towards choosing the
button.
DISABLED
public static final int DISABLED
- Indicates the button is currently disabled and
can't be changed.
ROLLOVER
public static final int ROLLOVER
- Indicates that the mouse is over the button.
JButtonModel
public JButtonModel()
- Constructs a JButtonModel
setActionCommand
public void setActionCommand(String actionCommand)
- Sets the actionCommand that gets sent when the putton is pressed.
getActionCommand
public String getActionCommand()
- Returns the action command for this button.
isArmed
public boolean isArmed()
- Checks if the button is armed.
isSelected
public boolean isSelected()
- Checks if the button is selected.
isDisabled
public boolean isDisabled()
- Checks if the button is disabled.
isPressed
public boolean isPressed()
- Checks if the button is pressed.
isRollover
public boolean isRollover()
- Checks if the button is rolled over.
setArmed
public void setArmed(boolean b)
- Sets the button to the armed state
setDisabled
public void setDisabled(boolean b)
- Sets the button to be enabled or disabled state
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.
setPressed
public void setPressed(boolean b)
- Sets the button to pressed state
setRollover
public void setRollover(boolean b)
- Sets the button to the rollover state
setKeyAccelerator
public void setKeyAccelerator(char aKey)
getKeyAccelerator
public char getKeyAccelerator()
addChangeListener
public void addChangeListener(ChangeListener l)
- adds a ChangeListener to the button
removeChangeListener
public void removeChangeListener(ChangeListener l)
- removes a ChangeListener from the button
addActionListener
public void addActionListener(ActionListener l)
- adds an ActionListener to the button
removeActionListener
public void removeActionListener(ActionListener l)
- removes an ActionListener from the button
addItemListener
public void addItemListener(ItemListener l)
- adds an ItemListener to the button
removeItemListener
public void removeItemListener(ItemListener l)
- removes an ItemListener from the button
getSelectedObjects
public Object[] getSelectedObjects()
setGroup
public void setGroup(ButtonGroup group)
All Packages Class Hierarchy This Package Previous Next Index