JavaFX Tutorial 11 - RadioButton, ToggleGroup

preview_player
Показать описание
Radio Buttons enable the user to choose a single item from a group of choice.

To group radio buttons, you need to create an object of ToggleGroup and set a radio button’s toggleGroup property to join the group as follows;

ToggleGroup tgFruit = new ToggleGroup();

In this way, only one radio button can be selected from the same button group for radio buttons.

Using the Scene Builder, this is a quite simple procedure. In this tutorial, you set the Toggle Group property to “tgFruit” for all three radio buttons.
Рекомендации по теме
Комментарии
Автор

Hi I was wondering if you could make a video tutorial on how to use skins in javafx and how to create them for applications.

libanbande
Автор

Hi Ken thank you for that explanation. Really good. What is that fxml editor that you use?

mariogarcia
visit shbcf.ru