Meaningless Drivel is fun!*
The moose likes Swing / AWT / SWT and the fly likes Toggling radio buttons Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Toggling radio buttons" Watch "Toggling radio buttons" New topic
Author

Toggling radio buttons

Avani Joshi
Greenhorn

Joined: Jul 09, 2007
Posts: 13
Hi,
I want to toggle the radio buttons using left right arrow key. The radio buttons are getting toggled using the tab key. Does any one know the solution to this?

- Thanks in advance.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37926
    
  22
You could try a KeyListener.
Brian Cole
Author
Ranch Hand

Joined: Sep 20, 2005
Posts: 862
Originally posted by Bhavna Maratkar:
I want to toggle the radio buttons using left right arrow key. The radio buttons are getting toggled using the tab key.


Do you really mean "toggle"?

Radio buttons don't really toggle to begin with, since you unselect
one by selecting another in the same group. But more than that, the
tab key doesn't select or unselect them anayway (at least not under
the usual LookAndFeels). It's the space bar that typically does that.

What the tab key does (usually) is change the focus, so perhaps your
question is actually a focus traversal question??
[ October 01, 2008: Message edited by: Brian Cole ]

bitguru blog
Avani Joshi
Greenhorn

Joined: Jul 09, 2007
Posts: 13
Thanks everyone for your help. I found the solution to this problem.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Toggling radio buttons
 
Similar Threads
setMnemonic(int)
deselecting radio button
MyFaces Tomahawk : Radio buttons in t:dataTable
how do i disable radio button in javascript
How can i insert JRadioButton to Cell in JTable