In one of my java swing application, I am dynamically open windows share folder. Now I want to open it using explorer. So can you guys please help me out to solve it.
To view the project explorer, click on Window menu then, click on Show View and select Project Explorer. There is simpler way to open project explorer, when you are in the editor press alt + shift + w and select project explorer.
The Java Desktop class contains an open() method that provides provision to open a file in Java. It is part of the java. awt package. Although Java is a platform-independent language, the Java Desktop class is platform-dependent. We need to check the system for Desktop support, before implementing this method.
In Java, the mkdir() function is used to create a new directory. This method takes the abstract pathname as a parameter and is defined in the Java File class. mkdir() returns true if the directory is created successfully; else, it returns false.
If you are using Java 6, the best way to do this is to use Desktop
:
Desktop.getDesktop().open(new File(path));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With