JDK-8253701 : Keyboard Navigation in RadioButton-Group Not Possible
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 9,10,11,12,13,14
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows
  • Submitted: 2020-09-28
  • Updated: 2020-09-29
  • Resolved: 2020-09-29
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdResolved
Related Reports
Duplicate :  
Description
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());
  }
}

Comments
Thanks for letting me know - I've tested with JDK15, I'll do a test with JDK16 and let you know if the issue still occurs.
29-09-2020

Please reopen - it's not a duplicate of JDK 8208640, even if it's the same misbehavior. The described issue occurs with Synth based L&F like Nimbus and occurs with recent JDK's - see posted test.
29-09-2020

It's a duplicate of JDK-8249548 which is fixed in 16b14. Which recent jdks have you tested with? have you tested with recent jdk16 builds?
29-09-2020

Possibly duplicate of JDK-8208640
28-09-2020