How to create a JRadioButton component?
This simple example shows you how to create a
component. To create an instance of
JRadioButton we can simply
call its constructor and pass a string as the radio button text.
We can also call the constructor with with a
after the text to indicate whether the radio button is selected or not.