Modifier and Type | Method and Description |
---|---|
void |
addActionListener(ActionListener listener)
adds an action listener to the Button.
|
boolean |
isSelected()
returns true if the button is in the selected (pressed) state
|
void |
setSelected(boolean selected)
sets the toggle button to selected (pressed) or not (un-pressed).
|
void |
setText(java.lang.String text)
sets the text of the ToggleButton.
|
setEnabled, setVisible
void addActionListener(ActionListener listener)
The action listener is invoked if the button is clicked and the mouse/finger is released inside the buttons frame.
listener
- the action listener to addvoid setSelected(boolean selected)
selected
- true to set the button selected, false to set it to unselected
stateboolean isSelected()
void setText(java.lang.String text)
Sets the text that will be displayed on the button.
text
- the text for the Button