Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JRadioButton

 
Tyson Lindner
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I deselect JRadioButtons? Method setSelected(false) is not working. Basically I want a user to be able to choose only one name between two, but can also choose neither name (by leaving the buttons deselected).
 
Brian Cole
Author
Ranch Hand
Posts: 908
1
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Presuming you're using a ButtonGroup, call ButtonGroup.clearSelection().
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic