test/javax/swing/JFileChooser/8046391/bug8046391.java

Print this page

        

@@ -45,19 +45,22 @@
         if (type != OSType.WINDOWS) {
             System.out.println("This test is for Windows only... skipping!");
             return;
         }
 
-        SwingUtilities.invokeAndWait(() -> {
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
             try {
                 UIManager.setLookAndFeel(new WindowsLookAndFeel());
             } catch (UnsupportedLookAndFeelException e) {
                 e.printStackTrace();
             }
             System.out.println("Creating JFileChooser...");
             JFileChooser fileChooser = new JFileChooser();
             System.out.println("Test passed: chooser = " + fileChooser);
+            }
         });
         // Test fails if creating JFileChooser hangs
     }
 
 }