public static void allowSwingToProcessEvents() {
		Runnable r = () -> {
			// do nothing...this is just a placeholder runnable that gets put onto the stack
		};
		runNow(r);
		runNow(r);
		runNow(r);
	}
Wait until AWT event queue (Swing) has been flushed and no more (to a point) events
are pending.
Ghidra/Framework/Utility/src/main/java/ghidra/util/Swing.java