I am trying to set the directory path in JFilechooser through something like this(using commons-io ) :
String fileContents = IOUtils.toString(new FileInputStream
Try to pass the current directory directly in the constructor:
filechooser = new JFileChooser(theDirectory);