API Overview API Index Package Overview Direct link to this page
JDK 1.6
  javax.swing. DefaultButtonModel View Source
Author(s)
Jeff Dinkins
Since
Version
1.49 05/25/06
Serial
Hierarchy
 Object
      DefaultButtonModel
Implements
 ButtonModel
 Serializable
Subclasses
Description
public class DefaultButtonModel
  The default implementation of a Button component's data model.
See also:   
Constructors
public DefaultButtonModel ()
Constructs a DefaultButtonModel.
Methods
Hide/Show inherited methods
public void addActionListener (ActionListener l) [Specified in ButtonModel]
Adds an ActionListener to the model.
public void addChangeListener (ChangeListener l) [Specified in ButtonModel]
Adds a ChangeListener to the model.
public void addItemListener (ItemListener l) [Specified in ButtonModel]
  Adds a listener to receive item events when the state of an item is changed by the user.
protected void fireActionPerformed (ActionEvent e)
  Notifies all listeners that have registered interest for notification on this event type.
protected void fireItemStateChanged (ItemEvent e)
  Notifies all listeners that have registered interest for notification on this event type.
protected void fireStateChanged ()
  Notifies all listeners that have registered interest for notification on this event type.
public String getActionCommand () [Specified in ButtonModel]
Returns the action command string for the button.
public ActionListener getActionListeners ()
  Returns an array of all the action listeners registered on this DefaultButtonModel.
public ChangeListener getChangeListeners ()
  Returns an array of all the change listeners registered on this DefaultButtonModel.
public ButtonGroup getGroup ()
  Returns the group that the button belongs to.
public ItemListener getItemListeners ()
  Returns an array of all the item listeners registered on this DefaultButtonModel.
public T getListeners (Class< T> listenerType)
  Returns an array of all the objects currently registered as FooListeners upon this model.
public int getMnemonic () [Specified in ButtonModel]
Gets the keyboard mnemonic for the button.
public Object getSelectedObjects ()
Overridden to return null.
public boolean isArmed () [Specified in ButtonModel]
Indicates partial commitment towards triggering the button.
public boolean isEnabled () [Specified in ButtonModel]
Indicates if the button can be selected or triggered by an input device, such as a mouse pointer.
pack-private boolean isMenuItem ()
public boolean isPressed () [Specified in ButtonModel]
Indicates if the button is pressed.
public boolean isRollover () [Specified in ButtonModel]
Indicates that the mouse is over the button.
public boolean isSelected () [Specified in ButtonModel]
  Indicates if the button has been selected.
public void removeActionListener (ActionListener l) [Specified in ButtonModel]
Removes an ActionListener from the model.
public void removeChangeListener (ChangeListener l) [Specified in ButtonModel]
Removes a ChangeListener from the model.
public void removeItemListener (ItemListener l) [Specified in ButtonModel]
  Removes an item listener.
public void setActionCommand (String actionCommand) [Specified in ButtonModel]
Sets the action command string that gets sent as part of the ActionEvent when the button is triggered.
public void setArmed (boolean b) [Specified in ButtonModel]
Marks the button as armed or unarmed.
public void setEnabled (boolean b) [Specified in ButtonModel]
Enables or disables the button.
public void setGroup (ButtonGroup group) [Specified in ButtonModel]
Identifies the group the button belongs to -- needed for radio buttons, which are mutually exclusive within their group.
pack-private void setMenuItem (boolean menuItem)
public void setMnemonic (int key) [Specified in ButtonModel]
Sets the keyboard mnemonic (shortcut key or accelerator key) for the button.
public void setPressed (boolean b) [Specified in ButtonModel]
Sets the button to pressed or unpressed.
public void setRollover (boolean b) [Specified in ButtonModel]
Sets or clears the button's rollover state
public void setSelected (boolean b) [Specified in ButtonModel]
Selects or deselects the button.
Fields
Hide/Show inherited fields
protected String actionCommand
The action command string fired by the button.
publicfinalstatic int ARMED = "1"
Identifies the "armed" bit in the bitmask, which indicates partial commitment towards choosing/triggering the button.
protectedtransient ChangeEvent changeEvent
  Only one ChangeEvent is needed per button model instance since the event's only state is the source property.
publicfinalstatic int ENABLED = "8"
Identifies the "enabled" bit in the bitmask, which indicates that the button can be selected by an input device (such as a mouse pointer).
protected ButtonGroup group
The button group that the button belongs to.
protected EventListenerList listenerList
Stores the listeners on this model.
protected int mnemonic
The button's mnemonic.
publicfinalstatic int PRESSED = "4"
Identifies the "pressed" bit in the bitmask, which indicates that the button is pressed.
publicfinalstatic int ROLLOVER = "16"
Identifies the "rollover" bit in the bitmask, which indicates that the mouse is over the button.
publicfinalstatic int SELECTED = "2"
  Identifies the "selected" bit in the bitmask, which indicates that the button has been selected.
protected int stateMask
The bitmask used to store the state of the button.
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar