ToggleGroup with ToggleButtons JavaFX


Question

How do I deselect all ToggleButtons in a ToggleGroup in JavaFX? There doesn't seem to be a clearSelection() feature like there was in Swing.

1
3
5/4/2014 11:30:35 PM

Accepted Answer

You can either do

toggleGroup.selectToggle(null);

or, if you know something is selected,

toggleGroup.getSelectedToggle().setSelected(false);
7
5/5/2014 12:11:19 AM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon