In this tutorial we are going to go over the JavaFX Radio Button implementation and how to use Toggle Groups to group them together.
First, lets talk a bit about what a Radio Button is. A radio button is a button that is typically grouped with other buttons in such a way that only one button can be selected at a time. Selecting a button, will automatically deselect the previous selection.
If you’ve been designing GUI’s for a while, you’ll know that we used to have to code this functionality manually. Ugg. Fortunately, we don’t have to do this anymore, and we can set all this up very easily and quickly in just a few steps.
First, we’ll look at how to do this in Scenebuilder, and then we’ll take a look at the FXML and the controller code to see the implementation there.