ToggleGroup does not manage its toggles
Hannes H.
dubaut at gmail.com
Tue Mar 16 11:50:34 UTC 2021
Hello,
while discussing a question on StackOverflow, I learned that a ToggleGroup
actually does not manage its toggles, but the toggles are responsible to
ensure that only one of them is selected at a time.
This topic came up because I want to apply exactly the same behavior of
RadioMenuItems in a ToggleGroup to a group of TitledPanes, which cannot be
placed in the same parent and therefore cannot reside in an Accordion (as
far as I understand it.) To solve my problem I implemented an Adapter that
basically maps the corresponding properties of the TitledPane to the one
required by the Toggle interface - and this did not work as expected.
Now, being a curious person, I would like to understand, why it is that the
ToggleGroup actually does not handle manage the selected state of its
toggles.
Does anyone know the background story behind this or is it something very
obvious I just don't see yet?
Have a great day,
Hannes
[1]
https://stackoverflow.com/questions/66644845/toggle-adapter-for-titledpane/66647505
More information about the openjfx-dev
mailing list