Skip to content

Commit 0e9c5ae

Browse files
amresh-sahushurymury
authored andcommittedFeb 18, 2021
8075909: [TEST_BUG] The regression-swing case failed as it does not have the 'Open' button when select 'subdir' folder with NimbusLAF
Reviewed-by: aivanov
1 parent e9f3aab commit 0e9c5ae

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed
 

‎test/jdk/javax/swing/JFileChooser/6698013/bug6698013.java

+9-9
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,19 @@
2121
* questions.
2222
*/
2323

24-
/* @test %W% %E%
24+
/* @test
2525
@bug 6698013
2626
@summary JFileChooser can no longer navigate non-local file systems.
27-
@author Pavel Porvatov
2827
@run applet/manual=done bug6698013.html
2928
*/
3029

31-
import javax.swing.*;
32-
import javax.swing.filechooser.FileSystemView;
3330
import java.io.File;
3431

32+
import javax.swing.JApplet;
33+
import javax.swing.JFileChooser;
34+
import javax.swing.SwingUtilities;
35+
import javax.swing.filechooser.FileSystemView;
36+
3537
public class bug6698013 extends JApplet {
3638

3739
final static VirtualFile root = new VirtualFile("testdir", true);
@@ -42,16 +44,14 @@ public class bug6698013 extends JApplet {
4244

4345
final static VirtualFile subdirFile = new VirtualFile("testdir/subdir/subtest.txt", false);
4446

45-
public static void main(String[] args) {
46-
JFileChooser chooser = new JFileChooser(new VirtualFileSystemView());
47-
chooser.setCurrentDirectory(root);
48-
chooser.showSaveDialog(null);
47+
public static void main(String[] args) throws Exception {
48+
SwingUtilities.invokeAndWait(() -> new bug6698013().init());
4949
}
5050

5151
public void init() {
5252
JFileChooser chooser = new JFileChooser(new VirtualFileSystemView());
5353
chooser.setCurrentDirectory(root);
54-
chooser.showSaveDialog(null);
54+
chooser.showOpenDialog(null);
5555
}
5656
}
5757

0 commit comments

Comments
 (0)
Please sign in to comment.