private void setText(final JTextField field, final String text, final boolean doAction)
			throws Exception {

		runSwing(() -> {
			field.setText(text);
			if (doAction) {
				ActionListener[] listeners = field.getActionListeners();
				if (listeners != null && listeners.length > 0) {
					listeners[0].actionPerformed(null);
				}
			}
		});
		waitForSwing();
	}
Tests for saving the tool config.
Ghidra/Features/ByteViewer/src/test.slow/java/ghidra/framework/plugintool/dialog/SaveToolConfigDialogTest.java