}
});
}
static void selectDirectory(Component parent, String selectedFile) {
JDirectoryChooser chooser;
if (System.getProperty("javawebstart.version") != null) {
chooser = new JDirectoryChooser(new FakeFileSystemView()) {
public void rescanCurrentDirectory() {
}
public void setCurrentDirectory(File dir) {
}
};
chooser.setShowingCreateDirectory(false);
} else {
chooser = new JDirectoryChooser();
if (selectedFile != null) {
chooser.setSelectedFile(new File(selectedFile));
}
}
JTextArea accessory = new JTextArea(RESOURCE
.getString("selectDirectory.message"));
accessory.setLineWrap(true);
accessory.setWrapStyleWord(true);
accessory.setEditable(false);
accessory.setOpaque(false);
accessory.setFont(UIManager.getFont("Tree.font"));
accessory.setFocusable(false);
chooser.setAccessory(accessory);
chooser.setMultiSelectionEnabled(true);
int choice = chooser.showOpenDialog(parent);
if (choice == JDirectoryChooser.APPROVE_OPTION) {
String filenames = "";
File[] selectedFiles = chooser.getSelectedFiles();
for (int i = 0, c = selectedFiles.length; i < c; i++) {
filenames += "\n" + selectedFiles[i];
}
JOptionPane.showMessageDialog(parent, RESOURCE.getString(
"selectDirectory.confirm", new Object[] {filenames}));