java - JradioButtons unchecking -


i have menu bar 2 menus on it.

on 1 of menus have difficulities easy,medium,hard.

when clicking on several of these radiobuttons stay checked. problem is: how uncheck them , make sure 1 of buttons can remain checked @ time?

i have tried doesnt seem work.

 if (easy.isselected() == (true))   {     medium.setselected(false);     hard.setselected(false);          }   if (medium.isselected() == (true))   {     easy.setselected(false);     hard.setselected(false);      }   if (hard.isselected() == (true))   {     easy.setselected(false);     medium.setselected(false);  } 

read section swing tutorial on how use button group. contains link on how use radio buttons code example.


Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

c++ - Correct method for redrawing a layered window -

java.util.scanner - How to read and add only numbers to array from a text file -