List of usage examples for javax.swing JFileChooser setFileSystemView
@BeanProperty(expert = true, description = "Sets the FileSytemView used to get filesystem information.") public void setFileSystemView(FileSystemView fsv)
JFileChooser
uses for accessing and creating file system resources, such as finding the floppy drive and getting a list of root drives. From source file:Main.java
public static void main(String[] argv) throws Exception { JFileChooser chooser = new JFileChooser(); File f = new File(new File("filename.txt").getCanonicalPath()); chooser.setFileSystemView(FileSystemView.getFileSystemView()); chooser.showDialog(new JFrame(""), null); File curFile = chooser.getSelectedFile(); }