JFileChooserpublic JFileChooser(File currentDirectory) Constructs a JFileChooser using the given File as the path. Passing in a null file causes the file chooser to point to the user's default directory. This default depends on the operating system. It is typically the "My Documents" folder on Windows, and the user's home directory on Unix.Parameters:currentDirectory - a File object specifying the path to a file or directory
JFileChooser chooser = new JFileChooser(); chooser.setSelectedFile(new File("C:\\a"));
Constructs a JFileChooser using the given File as the path. Passing in a null file causes the file chooser to point to the user's default directory. This default depends on the operating system. It is typically the "My Documents" folder on Windows, and the user's home directory on Unix.Parameters:currentDirectory - a File object specifying the path to a file or directory
chooser.setSelectedFile(new File("C:\\a"));