Results 1 to 6 of 6
- 10-13-2009, 11:48 PM #1
- 10-14-2009, 12:37 AM #2Member
- Join Date
- Aug 2009
- Rep Power
Within the reset button's click handler, can you not just do this:
myRadioButton1.setSelected(false); myRadioButton2.setSelected(false); myRadioButton3.setSelected(false); myRadioButton4.setSelected(false); myRadioButton5.setSelected(false);
Last edited by DiamondDog; 10-14-2009 at 12:39 AM.
If the JRadioButtons all share the same ButtonGroup, Java 1.6 allows you to clear the selection by a method in ButtonGroup which I can't remember for the moment, but if you look up the ButtonGroup API (again for Java 1.6), you will find it.
edit: Looked it up and it's clearSelection(). ButtonGroup#clearSelection()
If you have Java 1.5 or earlier, I've heard of some clearing the selection by creating an extra non-visualized (ghost) JRadioButton, and selecting it.
Last edited by Fubarable; 10-14-2009 at 01:03 AM.
- 10-14-2009, 01:04 AM #4
removing dot from radio button on reset button
I have just tried your suggestion but the dot is still left in the radio button, I have tried searches etc and cannot come up with anything that will do this.
Like I say I don't know if it is possible to do what I want.
Thanks in advance
- 10-14-2009, 01:06 AM #5
Fubarable, thanks, ill take a look.
- 10-14-2009, 01:17 AM #6
- By dbashby in forum New To JavaReplies: 4Last Post: 09-21-2009, 01:07 AM
- By linux1man in forum AWT / SwingReplies: 7Last Post: 03-21-2009, 05:01 AM
- By Java Tip in forum SWTReplies: 0Last Post: 07-25-2008, 03:26 PM
- By gtraylo in forum Java AppletsReplies: 1Last Post: 04-19-2008, 01:43 PM
- By swapnanair in forum JavaServer Pages (JSP) and JSTLReplies: 2Last Post: 12-03-2007, 09:39 AM