In this session, we will discuss the radio buttons grouping in our application. So we can select a single radio button at a time among them.
Using the following lines of code to perform grouping of Radiobuttons.
final ToggleGroup group = new ToggleGroup();
RadioButton rb1 = new RadioButton(“Home”);
rb1.setToggleGroup(group);
rb1.setSelected(true);
RadioButton rb2 = new RadioButton(“Calendar”);
rb2.setToggleGroup(group);
RadioButton rb3 = new RadioButton(“Contacts”);
rb3.setToggleGroup(group);
Please watch this video tutorial for full details of implementation.
If you find this video tutorial useful for you, please hit the like button and Subscribe to learn more.