private void build() {
		if (createBorder) {
			setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(1), title));
		}

		filenameTextField = new JTextField(20);
		filenameTextField.setText(defaultFileName);
		filenameTextField.getDocument().addDocumentListener(new DocumentListener() {
			@Override
			public void changedUpdate(DocumentEvent e) {
				fileChanged();
			}

			@Override
			public void insertUpdate(DocumentEvent e) {
				fileChanged();
			}

			@Override
			public void removeUpdate(DocumentEvent e) {
				fileChanged();
			}
		});

		chooseButton = new JButton("...");

		chooseButton.addActionListener(evt -> {
			File log = chooseFile(chooseButton, "Select " + (title == null ? "" : title));
			if (log != null) {
				boolean ok = true;
				if (mode == OUTPUT_MODE && log.exists()) {
					String questionTitle = "Overwrite Existing File?";
					String questionText = "The file " + log.getAbsolutePath() + " already exists." +
						"\n" + "Do you wish to overwrite it?";
					String buttonText = "Yes";
					int response = OptionDialog.showOptionDialog(chooseButton, questionTitle,
						questionText, buttonText, OptionDialog.QUESTION_MESSAGE);
					ok = response == OptionDialog.OPTION_ONE;
				}
				if (ok) {
					filenameTextField.setText(log.getAbsolutePath());
				}
				else {
					filenameTextField.setText("");
				}
				filenameTextField.requestFocus();
				filenameTextField.selectAll();
			}
		});

		setLayout(new GridBagLayout());
		GridBagConstraints gbc = new GridBagConstraints();
		gbc.gridx = 0;
		gbc.gridy = 0;

		if (!createBorder && title != null) {
			add(new GLabel(title), gbc);
		}

		gbc.fill = GridBagConstraints.HORIZONTAL;
		gbc.weightx = 1.0;
		gbc.insets = new Insets(5, 5, 5, 5);
		gbc.gridx++;
		add(filenameTextField, gbc);

		gbc.fill = GridBagConstraints.NONE;
		gbc.weightx = 0.0;
		gbc.gridx++;
		gbc.insets = new Insets(5, 5, 5, 5);
		add(chooseButton, gbc);
	}
Sets the file filter.
@param filter the new file filter
Ghidra/Framework/Docking/src/main/java/docking/widgets/filechooser/GhidraFileChooserPanel.java