<Swing Dev> RFR JDK-8067986: Test javax/swing/JComboBox/ConsumedKeyTest/ConsumedKeyTest.java fails

Prasanta Sadhukhan prasanta.sadhukhan at oracle.com
Mon Apr 27 16:02:44 UTC 2020


Hi All,

Please review a fix for an issue where it is seen that ComboBox is 
consuming Enter key without taking action on it.

The test was introduced by JDK-8058193 where the "Escape" and "Enter" 
key problem for ComboBox was fixed for mac, but it was seen still for 
windows and linux.

This is because for windows & linux, BasicComboBoxUI#accept "Enter" key 
but when actual actionPerformed() was done for Enter Key, it was seen 
that InputMap for VK_ENTER is not set up so no action is performed on it.

Proposed fix is to check upfront whether to accept this key VK_ENTER by 
checking if InputMap for VK_ENTER is set up or not, else fall back to 
SwingUtilities#notifyAction() where the user actionPerformed will be 
called instead.

Bug: https://bugs.openjdk.java.net/browse/JDK-8067986

webrev: http://cr.openjdk.java.net/~psadhukhan/8067986/webrev.0/

Regards
Prasanta


More information about the swing-dev mailing list