|
Quick Lists
|
|
Bug ID:
|
4226243
|
|
Votes
|
12
|
|
Synopsis
|
Require ability to navigate within groups of buttons using arrow keys
|
|
Category
|
java:classes_swing
|
|
Reported Against
|
1.5
, 1.1.6
, kestrel
, swing0.7
, swing0.8
, swing1.1
, merlin-rc1
, tiger-beta
|
|
Release Fixed
|
|
|
State
|
3-Accepted,
request for enhancement
|
|
Priority:
|
4-Low
|
|
Related Bugs
|
6247433
,
6298667
,
6310008
,
6314014
,
6320060
,
6320063
,
6331448
,
4302333
,
4633691
,
4104452
|
|
Submit Date
|
02-APR-1999
|
|
Description
|
There are many places within Swing where we should have the ability to navigate within groups of buttons using the arrow keys. The ones that come to mind are:
Groups of JRadioButtons
JOptionPane buttons
Potentially, within any ButtonGroup (perhaps with API to turn it on)
We need to implement something that provides this behavior. We need to apply it to JOptionPane by default, and possibly groups of JRadioButtons.
Original description below
---
This behaviour was observed in SwingSet so I don't know if its a demo application problem or JRadioButton problem. In SwingSet the radio buttons are visually and operationally (click one, a checked one unclicks) grouped together but the only way I can navigate this set is by tab navigation. In a group, tab navigation should move focus into and out of the group and the arrow keys should move the focus within the group.
xxxxx@xxxxx 2005-03-30 17:07:17 GMT
|
|
Work Around
|
N/A
|
|
Evaluation
|
We unfortunatly didn't design this with arrow key navigation in mind. We
do want to implement this, however.
---------------------
This is worthy of an investigation. The result may be an article / documentation on how to implement the desired behavior or a new JComponent that groups other components. It should be said that the problem is not with ButtonGroup, which was simply designed to enforce logic between the models of multiple buttons.
xxxxx@xxxxx 2001-11-14
xxxxx@xxxxx , made an attempt at fixing this via ButtonGroup some time ago. The fix was never reviewed, but may provide a great place to start. See:
http://sa.sfbay.sun.com/projects/swing_data/tiger/4104452.0
xxxxx@xxxxx 's comments, accompanying this e-mail are included in the comments section of this report.
xxxxx@xxxxx 2005-03-30 17:16:47 GMT
The fix for this bug was the cause of several regressions
it is decided to wait AWT to provide a good and safe solution
the fix was rollbacked and recommited to Dophin
Posted Date : 2005-09-13 13:47:33.0
It is unlikely we'll fix it for the core Swing components
but there is a useful component which provides the requested functionality
please the JXButtonPanel from the
https://swinghelper.dev.java.net/
Posted Date : 2007-05-04 16:51:48.0
|
|
Comments
|
Submitted On 09-JUL-1999
JoeyJ
This is an annoying problem, especially since the recently published "Java
Look and Feel Design Guidelines" clearly states on page 86 that the arrow
keys are part of the common operations on a component within a group.
Submitted On 21-OCT-2009
SebastianDietrich
The solution should not be that problematic. We fixed it (call it a work-around or a fix easily to be included in JDK7) easily: Change showOptionDialog and showInputDialog so that the arrow keys are added to the focus traversal keys. We had to do this in a subclass, but JDK could do it in JOptionPane itself: Just add the following lines after creation of the pane:
Set<AWTKeyStroke> set = new HashSet<AWTKeyStroke>(pane.getFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS));
set.add(KeyStroke.getKeyStroke("RIGHT"));
set.add(KeyStroke.getKeyStroke("UP"));
pane.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, set);
set = new HashSet<AWTKeyStroke>(pane.getFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS));
set.add(KeyStroke.getKeyStroke("LEFT"));
set.add(KeyStroke.getKeyStroke("DOWN"));
pane.setFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, set);
PLEASE NOTE: JDK6 is formerly known as Project Mustang
|
|
|
 |