Java: JRadio Button

       c1=new JRadioButton(" apple ");
        c2=new JRadioButton("    Orange     ");
 
        btGroup=new ButtonGroup();
       
        btGroup.add(cou1);
        btGroup.add(cou2);
        btGroup.add(cou3);
        Hi, i have radio buttons that are in a group. I am trying to get the value of the radio button that i select. how do i do that ?
zizi21Asked:
Who is Participating?
 
zizi21Author Commented:
hi,
if i use the getActionCommand() to get the string, than i have problem using it for buttons..coz, currently,
i am using actionPerformed for my jbuttons as well.
It is it possible to refresh the actioncommand ?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.