<Swing Dev> [14] RFR : JDK-8226892 : ActionListeners on JRadioButtons don't get notified when selection is changed with arrow keys

Ambarish Rapte ambarish.rapte at oracle.com
Mon Sep 30 07:59:00 UTC 2019


Please review this bug fix:

JBS: https://bugs.openjdk.java.net/browse/JDK-8226892 

Webrev: http://cr.openjdk.java.net/~arapte/a11y/8226892/webrev.00/ 



When a JRadioButton is selected using arrow key, the ActionListener of the JRadioButton does not get invoked.


Cause & Fix:

When a JRadioButton is selected using space key. Key press and release events are processed separately. The ActionListener is invoked on release key event received after the key press event.

The support for selection of JRadioButton using arrow keys was implemented for JDK-8033699. This functionality only selects and requests focus on JRadioButton when an arrow key is typed but does not invoke the calls for press and release event. Webrev.00 fixes this issue.



Verified that ItemListener, ChangeListener, FocusListener, ActionListener and KeyListener are invoked correctly when a JRadioButton is selected using arrow key and added a regression test. No JRadioButton test fails with the fix.




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/swing-dev/attachments/20190930/33e651fa/attachment.html>

More information about the swing-dev mailing list