Module java.desktop
Package javax.swing

Class DefaultButtonModel

java.lang.Object
javax.swing.DefaultButtonModel
All Implemented Interfaces:
ItemSelectable, Serializable, ButtonModel
Direct Known Subclasses:
JToggleButton.ToggleButtonModel

public class DefaultButtonModel
extends Object
implements ButtonModel, Serializable
The default implementation of a Button component's data model.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans™ has been added to the java.beans package. Please see XMLEncoder.

Since:
1.2
  • Field Details

    • stateMask

      protected int stateMask
      The bitmask used to store the state of the button.
    • actionCommand

      protected String actionCommand
      The action command string fired by the button.
    • group

      protected ButtonGroup group
      The button group that the button belongs to.
    • mnemonic

      protected int mnemonic
      The button's mnemonic.
    • changeEvent

      protected transient 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".
    • listenerList

      protected EventListenerList listenerList
      Stores the listeners on this model.
    • ARMED

      public static final int ARMED
      Identifies the "armed" bit in the bitmask, which indicates partial commitment towards choosing/triggering the button.
      See Also:
      Constant Field Values
    • SELECTED

      public static final int SELECTED
      Identifies the "selected" bit in the bitmask, which indicates that the button has been selected. Only needed for certain types of buttons - such as radio button or check box.
      See Also:
      Constant Field Values
    • PRESSED

      public static final int PRESSED
      Identifies the "pressed" bit in the bitmask, which indicates that the button is pressed.
      See Also:
      Constant Field Values
    • ENABLED

      public static final int ENABLED
      Identifies the "enabled" bit in the bitmask, which indicates that the button can be selected by an input device (such as a mouse pointer).
      See Also:
      Constant Field Values
    • ROLLOVER

      public static final int ROLLOVER
      Identifies the "rollover" bit in the bitmask, which indicates that the mouse is over the button.
      See Also:
      Constant Field Values
  • Constructor Details

  • Method Details