This week's giveaway is in the Threads forum.
We're giving away four copies of Java Concurrency Live Lessons and have Doug Schmidt on-line!
See this thread for details.
Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

want to get the value of selected radio button  RSS feed

 
jaimin gohel
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 20904
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!