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

Print this page

        

*** 45,63 **** if (type != OSType.WINDOWS) { System.out.println("This test is for Windows only... skipping!"); return; } ! SwingUtilities.invokeAndWait(() -> { 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 } } --- 45,66 ---- if (type != OSType.WINDOWS) { System.out.println("This test is for Windows only... skipping!"); return; } ! 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 } }