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.
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.
Static Constant.
Identifies the "armed" bit in the bitmask, which indicates partial commitment towards choosing/triggering the button.
type: int
Static Constant. Identifies the "armed" bit in the bitmask, which indicates partial commitment towards choosing/triggering the button. type: int
Static Constant.
Identifies the "enabled" bit in the bitmask, which indicates that the button can be selected by an input device (such as a mouse pointer).
type: int
Static Constant. Identifies the "enabled" bit in the bitmask, which indicates that the button can be selected by an input device (such as a mouse pointer). type: int
Static Constant.
Identifies the "pressed" bit in the bitmask, which indicates that the button is pressed.
type: int
Static Constant. Identifies the "pressed" bit in the bitmask, which indicates that the button is pressed. type: int
Static Constant.
Identifies the "rollover" bit in the bitmask, which indicates that the mouse is over the button.
type: int
Static Constant. Identifies the "rollover" bit in the bitmask, which indicates that the mouse is over the button. type: int
Static Constant.
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.
type: int
Static Constant. 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. type: int
(->default-button-model)
Constructor.
Constructs a DefaultButtonModel.
Constructor. Constructs a DefaultButtonModel.
(add-action-listener this l)
Adds an ActionListener to the model.
l - the listener to add - java.awt.event.ActionListener
Adds an ActionListener to the model. l - the listener to add - `java.awt.event.ActionListener`
(add-change-listener this l)
Adds a ChangeListener to the model.
l - the listener to add - javax.swing.event.ChangeListener
Adds a ChangeListener to the model. l - the listener to add - `javax.swing.event.ChangeListener`
(add-item-listener this l)
Adds an ItemListener to the model.
l - the listener to add - java.awt.event.ItemListener
Adds an ItemListener to the model. l - the listener to add - `java.awt.event.ItemListener`
(armed? this)
Indicates partial commitment towards triggering the button.
returns: true if the button is armed,
and ready to be triggered - boolean
Indicates partial commitment towards triggering the button. returns: true if the button is armed, and ready to be triggered - `boolean`
(enabled? this)
Indicates if the button can be selected or triggered by an input device, such as a mouse pointer.
returns: true if the button is enabled - boolean
Indicates if the button can be selected or triggered by an input device, such as a mouse pointer. returns: true if the button is enabled - `boolean`
(get-action-command this)
Returns the action command string for the button.
returns: the String that identifies the generated event - java.lang.String
Returns the action command string for the button. returns: the String that identifies the generated event - `java.lang.String`
(get-action-listeners this)
Returns an array of all the action listeners registered on this DefaultButtonModel.
returns: all of this model's ActionListeners
or an empty
array if no action listeners are currently registered - java.awt.event.ActionListener[]
Returns an array of all the action listeners registered on this DefaultButtonModel. returns: all of this model's ActionListeners or an empty array if no action listeners are currently registered - `java.awt.event.ActionListener[]`
(get-change-listeners this)
Returns an array of all the change listeners registered on this DefaultButtonModel.
returns: all of this model's ChangeListeners
or an empty
array if no change listeners are currently registered - javax.swing.event.ChangeListener[]
Returns an array of all the change listeners registered on this DefaultButtonModel. returns: all of this model's ChangeListeners or an empty array if no change listeners are currently registered - `javax.swing.event.ChangeListener[]`
(get-group this)
Returns the group that the button belongs to. Normally used with radio buttons, which are mutually exclusive within their group.
returns: the ButtonGroup that the button belongs to - javax.swing.ButtonGroup
Returns the group that the button belongs to. Normally used with radio buttons, which are mutually exclusive within their group. returns: the ButtonGroup that the button belongs to - `javax.swing.ButtonGroup`
(get-item-listeners this)
Returns an array of all the item listeners registered on this DefaultButtonModel.
returns: all of this model's ItemListeners
or an empty
array if no item listeners are currently registered - java.awt.event.ItemListener[]
Returns an array of all the item listeners registered on this DefaultButtonModel. returns: all of this model's ItemListeners or an empty array if no item listeners are currently registered - `java.awt.event.ItemListener[]`
(get-listeners this listener-type)
Returns an array of all the objects currently registered as FooListeners upon this model. FooListeners are registered using the addFooListener method.
You can specify the listenerType argument with a class literal, such as FooListener.class. For example, you can query a DefaultButtonModel instance m for its action listeners with the following code:
ActionListener[] als = (ActionListener[])(m.getListeners(ActionListener.class));
If no such listeners exist, this method returns an empty array.
listener-type - the type of listeners requested; this parameter should specify an interface that descends from java.util.EventListener - java.lang.Class
returns: an array of all objects registered as
FooListeners
on this model,
or an empty array if no such
listeners have been added - <T extends java.util.EventListener> T[]
throws: java.lang.ClassCastException - if listenerType doesn't specify a class or interface that implements java.util.EventListener
Returns an array of all the objects currently registered as FooListeners upon this model. FooListeners are registered using the addFooListener method. You can specify the listenerType argument with a class literal, such as FooListener.class. For example, you can query a DefaultButtonModel instance m for its action listeners with the following code: ActionListener[] als = (ActionListener[])(m.getListeners(ActionListener.class)); If no such listeners exist, this method returns an empty array. listener-type - the type of listeners requested; this parameter should specify an interface that descends from java.util.EventListener - `java.lang.Class` returns: an array of all objects registered as FooListeners on this model, or an empty array if no such listeners have been added - `<T extends java.util.EventListener> T[]` throws: java.lang.ClassCastException - if listenerType doesn't specify a class or interface that implements java.util.EventListener
(get-mnemonic this)
Gets the keyboard mnemonic for the button.
returns: an int specifying the accelerator key - int
Gets the keyboard mnemonic for the button. returns: an int specifying the accelerator key - `int`
(get-selected-objects this)
Overridden to return null.
returns: java.lang.Object[]
Overridden to return null. returns: `java.lang.Object[]`
(pressed? this)
Indicates if the button is pressed.
returns: true if the button is pressed - boolean
Indicates if the button is pressed. returns: true if the button is pressed - `boolean`
(remove-action-listener this l)
Removes an ActionListener from the model.
l - the listener to remove - java.awt.event.ActionListener
Removes an ActionListener from the model. l - the listener to remove - `java.awt.event.ActionListener`
(remove-change-listener this l)
Removes a ChangeListener from the model.
l - the listener to remove - javax.swing.event.ChangeListener
Removes a ChangeListener from the model. l - the listener to remove - `javax.swing.event.ChangeListener`
(remove-item-listener this l)
Removes an ItemListener from the model.
l - the listener to remove - java.awt.event.ItemListener
Removes an ItemListener from the model. l - the listener to remove - `java.awt.event.ItemListener`
(rollover? this)
Indicates that the mouse is over the button.
returns: true if the mouse is over the button - boolean
Indicates that the mouse is over the button. returns: true if the mouse is over the button - `boolean`
(selected? this)
Indicates if the button has been selected. Only needed for certain types of buttons - such as radio buttons and check boxes.
returns: true if the button is selected - boolean
Indicates if the button has been selected. Only needed for certain types of buttons - such as radio buttons and check boxes. returns: true if the button is selected - `boolean`
(set-action-command this action-command)
Sets the action command string that gets sent as part of the ActionEvent when the button is triggered.
action-command - the String that identifies the generated event - java.lang.String
Sets the action command string that gets sent as part of the ActionEvent when the button is triggered. action-command - the String that identifies the generated event - `java.lang.String`
(set-armed this b)
Marks the button as armed or unarmed.
b - whether or not the button should be armed - boolean
Marks the button as armed or unarmed. b - whether or not the button should be armed - `boolean`
(set-enabled this b)
Enables or disables the button.
b - whether or not the button should be enabled - boolean
Enables or disables the button. b - whether or not the button should be enabled - `boolean`
(set-group this group)
Identifies the group the button belongs to -- needed for radio buttons, which are mutually exclusive within their group.
group - the ButtonGroup the button belongs to - javax.swing.ButtonGroup
Identifies the group the button belongs to -- needed for radio buttons, which are mutually exclusive within their group. group - the ButtonGroup the button belongs to - `javax.swing.ButtonGroup`
(set-mnemonic this key)
Sets the keyboard mnemonic (shortcut key or accelerator key) for the button.
key - an int specifying the accelerator key - int
Sets the keyboard mnemonic (shortcut key or accelerator key) for the button. key - an int specifying the accelerator key - `int`
(set-pressed this b)
Sets the button to pressed or unpressed.
b - whether or not the button should be pressed - boolean
Sets the button to pressed or unpressed. b - whether or not the button should be pressed - `boolean`
(set-rollover this b)
Sets or clears the button's rollover state
b - whether or not the button is in the rollover state - boolean
Sets or clears the button's rollover state b - whether or not the button is in the rollover state - `boolean`
(set-selected this b)
Selects or deselects the button.
b - true selects the button, false deselects the button - boolean
Selects or deselects the button. b - true selects the button, false deselects the button - `boolean`
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close