javax.swing

Class JToggleButton.ToggleButtonModel

public static class JToggleButton.ToggleButtonModel extends DefaultButtonModel

The model handles the storage and maintenance of the state of the toggle button. This follows the same paradigm (the MVC or Model-View-Controller design pattern) employed by other Swing components, where the data associated with a component is stored separately from the display aspects.
Method Summary
booleanisSelected()
Checks if the button is selected.
voidsetPressed(boolean p)
Sets the pressed state of the button.
voidsetSelected(boolean b)
Sets the selected state of the button.

Method Detail

isSelected

public boolean isSelected()
Checks if the button is selected.

Returns: true if the button is selected.

setPressed

public void setPressed(boolean p)
Sets the pressed state of the button. The selected state of the button also changes follwing the button being pressed.

Parameters: p true if the button is pressed down.

setSelected

public void setSelected(boolean b)
Sets the selected state of the button.

Parameters: b true if button is selected