-
Bug
-
Resolution: Fixed
-
P3
-
8u40, 9
-
b74
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8136131 | emb-9 | Semyon Sadetsky | P3 | Resolved | Fixed | team |
JDK-8266216 | 8u311 | Alexey Ivanov | P3 | Resolved | Fixed | b01 |
JDK-8270324 | 7u321 | Alexey Ivanov | P3 | Resolved | Fixed | b02 |
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.3.9600]
A DESCRIPTION OF THE PROBLEM :
The JFrame is defined to treat ENTER as a forward traversal key equivalent to TAB:
Set<KeyStroke> keystrokes = new HashSet<KeyStroke>();
keystrokes.add(KeyStroke.getKeyStroke("TAB"));
keystrokes.add(KeyStroke.getKeyStroke("ENTER"));
frame.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, keystrokes);
This works correctly in all versions of Java on all platforms through 8u31. In 8u40, 8u45, and 8u60-ea on Windows, radio buttons do not honor non-standard FocusTraversalKeys.
REGRESSION. Last worked in version 8u31
ADDITIONAL REGRESSION INFORMATION:
java version "1.8.0_31"
Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the attached sample in 8u40 or higher in Windows.
Press ENTER to navigate through the components.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Expected ENTER to work as a forward traversal key on all components.
ACTUAL -
The text components correctly recognize both TAB and ENTER as a forward traversal key; the radio buttons only recognize TAB.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.*;
import java.util.*;
import javax.swing.*;
public class FocusTraversalTest
{
public static void main(String[] args) throws Exception
{
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
JFrame frame = new JFrame("FocusTraversalTest");
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
Set<KeyStroke> keystrokes = new HashSet<KeyStroke>();
keystrokes.add(KeyStroke.getKeyStroke("TAB"));
keystrokes.add(KeyStroke.getKeyStroke("ENTER"));
frame.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, keystrokes);
JRadioButton a = new JRadioButton("a");
JRadioButton b = new JRadioButton("b");
JRadioButton c = new JRadioButton("c");
JRadioButton d = new JRadioButton("d");
ButtonGroup radioButtonGroup = new ButtonGroup();
radioButtonGroup.add(a);
radioButtonGroup.add(b);
radioButtonGroup.add(c);
radioButtonGroup.add(d);
JPanel panel = new JPanel();
panel.add(new JTextField("text"));
panel.add(new JTextField("text"));
panel.add(a);
panel.add(b);
panel.add(c);
panel.add(d);
panel.add(new JTextField("text"));
panel.add(new JTextField("text"));
JPanel root = new JPanel();
root.setLayout(new BorderLayout());
root.add(panel, BorderLayout.CENTER);
root.add(new JButton("OK"), BorderLayout.SOUTH);
frame.add(root);
frame.pack();
frame.setVisible(true);
}
}
---------- END SOURCE ----------
- backported by
-
JDK-8136131 JRadioButton does not honor non-standard FocusTraversalKeys
-
- Resolved
-
-
JDK-8266216 JRadioButton does not honor non-standard FocusTraversalKeys
-
- Resolved
-
-
JDK-8270324 JRadioButton does not honor non-standard FocusTraversalKeys
-
- Resolved
-
- relates to
-
JDK-8033699 Incorrect radio button behavior
-
- Resolved
-
-
JDK-8132770 [TEST_BUG][macosx] Test javax/swing/JRadioButton/FocusTraversal/FocusTraversal.java fails in MacOSX
-
- Resolved
-
-
JDK-8130893 Focus does not navigate to the second radio button when added to Button Group
-
- Closed
-
- links to
-
Review openjdk/jdk8u-dev/41