toolBar.add(pathField);
return toolBar;
}
public File[] showOpenDialog() {
Configuration config = app.getConfiguration();
String path = config.getString("playlists.lastDir", null);
if (path != null) {
File file = new File(path);
if (file.exists())
directoryChooser.setSelectedFile(file);
}
setVisible(true);
dispose();
File[] files = directoryChooser.getSelectedFiles();
if (files.length > 0) {
File dir = files[0];
while (dir != null && !dir.isDirectory()) {
dir = dir.getParentFile();
}
if (dir != null) {
config.setString("playlists.lastDir", dir.getAbsolutePath());
}
}
return selectedFiles;
}