In Java swing, a user can select more than one radio button simultaneously, so that it does not happen, one can do:
private void radio1ActionPerformed(java.awt.event.ActionEvent evt) {
if (radio1.isSeleced()) {
radio2.isSelected(false);
}
}
But this is very impractical, imagine a situation that requires dozens of radio buttons, it would be too much trouble.
Is there any other way to do what I want? I thought about using a foreach by putting all the radio buttons inside a vector, but I could not abstract anything.