This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Swing / AWT / SWT and the fly likes want to get the value of selected radio button Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "want to get the value of selected radio button" Watch "want to get the value of selected radio button" New topic
Author

want to get the value of selected radio button

jaimin gohel
Greenhorn

Joined: Jul 30, 2008
Posts: 13
I am having 2 radio button and i want to get a value on selection of any one of the radio button.

like if "YES" it selected value should be "True" or boolean "t" and same way if the radio button "NO" is selected value should be "False" or boolean "f".

i am not able to find any sort of event on the selection of the radio button.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19679
    
  18

That's because the methods for retrieving and setting the state is not in JRadioButton but its superclass, AbstractButton. They're called isSelected and setSelected.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: want to get the value of selected radio button