I have the following piece of code:
GridPane gp = new GridPane();
// filling GridPane with other nodes...
RadioButton maschio = new RadioButton("M");
RadioButton femmina = new RadioButton("F");
final ToggleGroup tg = new ToggleGroup();
maschio.setToggleGroup(tg);
femmina.setToggleGroup(tg);
gp.add(tg, 1, 3);
I got an error on the last line saying: ToggleGroup cannot be converted to Node
.
What can I do? I also tried with Vbox, Hbox
but it didn't work.
Tried to Google but didn't find the solution. Any suggestions?