Is there a relationship between Toggle and e.g. RadioButton behind this?

Image, for example. 2 RadioButtons that have one ToggleGroup. Using

ToggleGroup.getToggles()

      

you can access all Toggles ToggleGroup. But is there any reference from Toggle to RadioButton that is linked to?

0


source to share


1 answer


If I understood correctly the question you are looking for:

RadioButton button = (RadioButton) toggleGroup.getSelectedToggle();

      

Unfortunately ToggleGroup is not a "generator" yet, so you need to do a cast.



But is there any reference from Toggle to RadioButton that is related?

Or in other words: RadioButton is (implements) Toggle, no reference.

+1


source







All Articles