- java.lang.Object
- 
- javax.swing.DefaultButtonModel
- 
- javax.swing.JToggleButton.ToggleButtonModel
 
 
- 
- All Implemented Interfaces:
- ItemSelectable,- Serializable,- ButtonModel
 - Enclosing class:
- JToggleButton
 
 public static class JToggleButton.ToggleButtonModel extends DefaultButtonModel The ToggleButton modelWarning: 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.beanspackage. Please seeXMLEncoder.- See Also:
- Serialized Form
 
- 
- 
Field Summary- 
Fields declared in class javax.swing.DefaultButtonModelactionCommand, ARMED, changeEvent, ENABLED, group, listenerList, mnemonic, PRESSED, ROLLOVER, SELECTED, stateMask
 
- 
 - 
Constructor SummaryConstructors Constructor Description ToggleButtonModel()Creates a new ToggleButton Model
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisSelected()Checks if the button is selected.voidsetPressed(boolean b)Sets the pressed state of the toggle button.voidsetSelected(boolean b)Sets the selected state of the button.- 
Methods declared in interface javax.swing.ButtonModeladdActionListener, addChangeListener, addItemListener, getActionCommand, getMnemonic, isArmed, isEnabled, isPressed, isRollover, removeActionListener, removeChangeListener, removeItemListener, setActionCommand, setArmed, setEnabled, setGroup, setMnemonic, setRollover
 - 
Methods declared in class javax.swing.DefaultButtonModelfireActionPerformed, fireItemStateChanged, fireStateChanged, getActionListeners, getChangeListeners, getGroup, getItemListeners, getListeners, getSelectedObjects
 
- 
 
- 
- 
- 
Method Detail- 
isSelectedpublic boolean isSelected() Checks if the button is selected.- Returns:
- trueif the button is selected
 
 - 
setSelectedpublic void setSelected(boolean b) Sets the selected state of the button.- Parameters:
- b- true selects the toggle button, false deselects the toggle button.
 
 - 
setPressedpublic void setPressed(boolean b) Sets the pressed state of the toggle button.- Parameters:
- b- whether or not the button should be pressed
- See Also:
- ButtonModel.isPressed()
 
 
- 
 
-