This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: JRadio
It's not a secret anymore!