private GhidraFileChooser createFileChooser(String extension, final String description,
			String filePathName) {

		GhidraFileChooser fileChooser = new GhidraFileChooser(getComponent());
		fileChooser.setFileSelectionMode(GhidraFileChooserMode.FILES_ONLY);
		fileChooser.setFileFilter(new GhidraFileFilter() {
			@Override
			public boolean accept(File file, GhidraFileChooserModel model) {
				if (file == null) {
					return false;
				}

				if (file.isDirectory()) {
					return true;
				}

				return file.getAbsolutePath()
						.toLowerCase()
						.endsWith(ArchivePlugin.ARCHIVE_EXTENSION);
			}

			@Override
			public String getDescription() {
				return description;
			}
		});

		// start the browsing in the user's preferred project directory
		File startDirectory = null;
		if ((filePathName != null) && (filePathName.length() > 0)) {
			startDirectory = new File(filePathName);
			if (startDirectory.isDirectory()) {
				fileChooser.setCurrentDirectory(startDirectory);
			}
			else {
				if (!filePathName.endsWith(extension)) {
					startDirectory = new File(filePathName + extension);
				}
				fileChooser.setSelectedFile(startDirectory);
			}
		}
		if (startDirectory == null) {
			startDirectory = new File(GenericRunInfo.getProjectsDirPath());
			fileChooser.setCurrentDirectory(startDirectory);
		}

		return fileChooser;
	}
Creates a file chooser for selecting files with the specified extension.
@param extension the file extension for valid files to choose.
@param description the description for the extension
@param filePathName the file path indicating the default directory/file
to select.
@return the file chooser.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/archive/ArchiveDialog.java