I am trying to set the directory path in JFilechooser through something like this(using commons-io ) :
String fileContents = IOUtils.toString(new FileInputStream
For select the last directory that you open :
chooser.setCurrentDirectory(lastDirectory); int r = chooser.showOpenDialog(new JPanel()); if (r == JFileChooser.APPROVE_OPTION) { fileName = chooser.getSelectedFile().getPath(); lastDirectory = chooser.getSelectedFile(); }