On Wed, 28 Sep 2022 09:00:33 GMT, Alexey Ivanov <[email protected]> wrote:
>> test/jdk/javax/swing/plaf/nimbus/PasswordFieldTest.java line 50:
>>
>>> 48: UIManager.getInstalledLookAndFeels()) {
>>> 49: System.out.println("Testing L&F: " + laf.getClassName());
>>> 50: SwingUtilities.invokeAndWait(() -> setLookAndFeel(laf));
>>
>> You should probably call `setLookAndFeel` on the main thread, or you should
>> call `UIManager.get` below on the EDT as well.
>
>> You should probably call `setLookAndFeel` on the main thread, or you should
>> call `UIManager.get` below on the EDT as well.
>
> In fact, I was inclined to use the main thread, it produces a shorter stack
> trace. EDT is okay, no change is required if you don't feel like it.
Normally, many tests does this only which is what I did initially..
public static void main(String[] args) throws Exception {
for (UIManager.LookAndFeelInfo laf : UIManager.getInstalledLookAndFeels()) {
System.out.println("Testing l&f : " + laf.getClassName());
SwingUtilities.invokeAndWait(() -> setLookAndFeel(laf));
but I guess the present one will suffice too...
-------------
PR: https://git.openjdk.org/jdk/pull/10035