@Override
	public void moveBlockCompleted(MoveBlockTask task) {

		setCursor(Cursor.getDefaultCursor());
		boolean success = task.wasSuccessful();
		setOkEnabled(success);
		setStatusText(task.getStatusMessage());

		Swing.runLater(() -> {
			if (success) {
				close();
				model.dispose();
			}
		});
	}
Dialog that uses a model to validate the fields for moving a block of memory.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/memory/MoveBlockDialog.java