// Create the file chooser at a default initial directory.
String initialDir = getPreferences().get(EXPORT_MODULE_DIRECTORY_PREF_KEY, ADD_MODULE_DIRECTORY_DEFAULT);
JFileChooser fileChooser = new JFileChooser(initialDir);
// Create and set the file filter.
FileFilter fileFilter = new ExtensionFileFilter(JAR_FILE_EXTENSION, getResourceString("JarFiles"));
fileChooser.setFileFilter(fileFilter);
// Also accept the accept all filter.
fileChooser.setAcceptAllFileFilterUsed(true);