Java tutorial
import javax.swing.JFileChooser; import javax.swing.filechooser.FileSystemView; public class UsingFileSystemView { public static void main(String[] a) { JFileChooser chooser = new JFileChooser(); FileSystemView view = chooser.getFileSystemView(); System.out.println(view.getDefaultDirectory()); } }