************************************************************************
COMPLETE SOURCE CODE FOR : OpenFolderInJava.java
Thank you to Ankur Pandya for this source codes.
************************************************************************
/// file OpenFolderInJava.java ////
import java.util.*;
import java.io.*;
import java.awt.Desktop;
class OpenFolderInJava{
public static void main(String[] arg){
String path = "."; // path to the directory to be opened
File file = new File("C:\\");
Desktop desktop = null;
// Before more Desktop API is used, first check
// whether the API is supported by this particular
// virtual machine (VM) on this particular host.
if (Desktop.isDesktopSupported()) {
desktop = Desktop.getDesktop();
}
try {
desktop.open(file);
}
catch (IOException e){
}
}
}
/// end of file ///
************************************************************************
JUST COMPILE AND EXECUTE
************************************************************************