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 JRadio Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JRadio " Watch "JRadio " New topic



Joined: Oct 28, 2000
Posts: 12
Hi there,
I am having this kind of problem. Suppose I have a group of 5 radio buttons, each radion button associate with a text. When I select one radio button, I would like to get the associated text with this radio button.
Any help would be appreciated. Thanks!
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Hi qhyang,
If you want the text displayed by the JRadioButton
the method is implemented in its parent class AbstractButton:

So you would call that method something like this:

Hope this helps,
Michael Morris

Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher

Joined: Oct 28, 2000
Posts: 12
It works well.
Michael, Thanks a lot!
I agree. Here's the link:
subject: JRadio
It's not a secret anymore!