@Override
	protected void okCallback() {
		if (checkInput()) {
			// Check if archive file exists.
			String archive = archiveField.getText().trim();
			if (!archive.endsWith(ArchivePlugin.ARCHIVE_EXTENSION)) {
				archive += ArchivePlugin.ARCHIVE_EXTENSION;
			}
			File file = new File(archive);
			if (file.exists() && OptionDialog.showOptionDialog(rootPanel, "Archive File Exists",
				"File " + archive + " exists.\n " + "Do you want to overwrite existing file?",
				"Yes") != OptionDialog.OPTION_ONE) {
				return;
			}

			actionComplete = true;
			close();
		}
		else {
			rootPanel.getToolkit().beep();
		}
	}
Gets called when the user clicks on the OK Action for the dialog.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/archive/ArchiveDialog.java