ToggleButton
class ToggleButton(text: String, graphic: Node? = null, initialToggleGroup: ToggleGroup? = null) : ToggleButtonBase
A button which has a boolean selected state. If a ToggleButton is part of a ToggleGroup, then selecting one button will de-select all others. If the same button is pressed again, then it is also de-selected (so no buttons in the ToggleGroup are selected). If you always want one button to be selected, then use RadioButton instead.
Theme DSL
"toggle_button" {
":selected" { ... }
}
Content copied to clipboard
ToggleButton inherits all the features of ButtonBase.
The analogous class for use in menus is ToggleMenuItem.