File outputFile = new File(startingPath);
if (outputFile.exists()) {
chooser.setCurrentDirectory(outputFile);
}
chooser.setTitle(title);
int choice = chooser.showOpenDialog(parent);
if (choice == JFolderChooser.APPROVE_OPTION) {
return chooser.getSelectedFile().getPath();
}
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "There has been an error:" + StringHelper.newline + e);