aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JRadioButton!!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JRadioButton!!!" Watch "JRadioButton!!!" New topic
Author

JRadioButton!!!

vikas de
Ranch Hand

Joined: Feb 07, 2001
Posts: 39
Hi Guys,
i have added JRadioButtons in my app...the prob is that i can select all RadioButtons instead of one...(Very Strange to me )i want that the user can only select one...!???
please help its urgent
vikas
feel free to mail me vikasde@usa.net & vikasde@rediffmail.com
Bill Prentice
Greenhorn

Joined: Mar 06, 2001
Posts: 26
I think you need a button group, something like this:-
ButtonGroup slotStatusRadioButtonGroup = new ButtonGroup();

JRadioButton notSelectedRadioButton = new JRadioButton(notSelectedText, true);
JRadioButton selectedRadioButton = new JRadioButton(selectedText, false);
JRadioButton markedRadioButton = new JRadioButton(markedText, false);
slotStatusRadioButtonGroup.add(notSelectedRadioButton);
slotStatusRadioButtonGroup.add(selectedRadioButton);
slotStatusRadioButtonGroup.add(markedRadioButton);
Obviously you would intialise the JRadioButtons to meet your own requirements.
Hope this helps
Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JRadioButton!!!