RFR: 8280948: [TESTBUG] Write a regression test for JDK-4659800

Manukumar V S mvs at openjdk.java.net
Thu Feb 3 15:32:06 UTC 2022


On Thu, 3 Feb 2022 15:24:25 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

> I must be missing something but [JDK-4659800](https://bugs.openjdk.java.net/browse/JDK-4659800) talks about the Enter key, not the Space key: _Hitting enter on focused JButton no longer causes action_.
> 
> It looks you're testing a completely different thing.
> 
> Yes, Space key _always_ activates the focused button. Whether Enter key activates focused button is L&F dependent. The test case in JDK-4659800 changes the L&F to WindowsLookAndFeel therefore Enter key is expected to cause the ActionEvent; if you leave the default MetalLookAndFeel or use NimbusLookAndFeel, pressing the Enter key should not send the ActionEvent.

Yea, you are correct, I first tried with <ENTER> key and it was failing with MetalLookAndFeel or use NimbusLookAndFeel, so I thought of changing it to <SPACE> so that it pass in all LnFs, may be I can add that use-case also here, or it would be a separate test case by itself?

-------------

PR: https://git.openjdk.java.net/jdk/pull/7296



More information about the client-libs-dev mailing list