List of usage examples for javax.swing.filechooser FileSystemView getRoots
public File[] getRoots()
From source file:MainClass.java
public static void main(String[] args) { JFileChooser chooser = new JFileChooser(); FileSystemView view = chooser.getFileSystemView(); System.out.println("The roots of this filesystem are: "); File[] roots = view.getRoots(); for (int i = 0; i < roots.length; i++) { System.out.println(" " + roots[i]); }//from w w w. j ava2 s . com }