I am trying to set the directory path in JFilechooser through something like this(using commons-io ) :
String fileContents = IOUtils.toString(new FileInputStream
In your main class declare
public static String dirpath="."; private void btnBrowseActionPerformed(java.awt.event.ActionEvent evt) { JFileChooser jfc = new JFileChooser(dirpath); dirpath =jfc.getSelectedFile().getAbsolutePath().toString(); }