It never answered properly or carefully, so I decided to post the solution I received.
When creating radio buttons in SceneBuilder , then use SceneBuilder to assign them to the group. The way to access this group through the controller is to first create a variable of type ToggleGroup in the controller and call it the same name as the one you created in SceneBuilder . Then you can use it. Here is an example of pseudo code as I did it:
Although the text returned from the getUserData property is long. Here's how to get the name of the radio button:
myGroup.selectedToggleProperty().addListener(new ChangeListener<Toggle>() { @Override public void changed(ObservableValue<? extends Toggle> ov, Toggle t, Toggle t1) { RadioButton chk = (RadioButton)t1.getToggleGroup().getSelectedToggle();
Hope this helps someone along the way ...
source share