In this example, we have seven JToggleButton components. First 4 is for the Nationality and second three is for the Sex. Here, these toggle buttons act like a radio button. One can also note that there are two groups here. In a group, only one toggle button can stay in Switched ON state. The above picture shows France and Female is in Selected State. Now, we will implement this example.