File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JRadioButton!!!" Watch "JRadioButton!!!" New topic


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
feel free to mail me &
Bill Prentice

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);
Obviously you would intialise the JRadioButtons to meet your own requirements.
Hope this helps
I agree. Here's the link:
subject: JRadioButton!!!
It's not a secret anymore!