-
Bug
-
Resolution: Duplicate
-
P4
-
9, 10, 11, 12, 13, 14
-
None
-
windows
Navigation/selection with keyboard of each JRadioButton in a ButtonGroup is not possible when a Synth based Look and Feel like Nimbus is used. The test below demonstrates the issue- the issue was introduced with Java 9. The relevant code is in located in BasicRadioButtonUI - it looks like KeyHandler and actions haven't been ported to SynthRadioButtonUI for some reason.
public class RadioButtonGroupTest extends JFrame
{
public RadioButtonGroupTest()
{
setName(getClass().getSimpleName());
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLayout(new FlowLayout());
final JRadioButton one = new JRadioButton("one");
final JRadioButton two = new JRadioButton("two");
final JRadioButton three = new JRadioButton("three");
add(one);
add(two);
add(three);
add(new JButton("hello"));
final ButtonGroup grp = new ButtonGroup();
grp.add(one);
grp.add(two);
grp.add(three);
setSize(300, 400);
setLocationRelativeTo(null);
setVisible(true);
}
public static void main(final String[] args) throws Exception
{ UIManager.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel");
SwingUtilities.invokeLater(() -> new RadioButtonGroupTest());
}
}
public class RadioButtonGroupTest extends JFrame
{
public RadioButtonGroupTest()
{
setName(getClass().getSimpleName());
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLayout(new FlowLayout());
final JRadioButton one = new JRadioButton("one");
final JRadioButton two = new JRadioButton("two");
final JRadioButton three = new JRadioButton("three");
add(one);
add(two);
add(three);
add(new JButton("hello"));
final ButtonGroup grp = new ButtonGroup();
grp.add(one);
grp.add(two);
grp.add(three);
setSize(300, 400);
setLocationRelativeTo(null);
setVisible(true);
}
public static void main(final String[] args) throws Exception
{ UIManager.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel");
SwingUtilities.invokeLater(() -> new RadioButtonGroupTest());
}
}
- duplicates
-
JDK-8249548 backward focus traversal gets stuck in button group
-
- Resolved
-