private static int loadTimeout() {
		String timeoutString = System.getProperty(SWING_TIMEOUT_SECONDS_PROPERTY,
			Integer.toString(SWING_TIMEOUT_SECONDS_DEFAULT_VALUE));

		try {
			return Integer.parseInt(timeoutString);
		}
		catch (NumberFormatException e) {
			return SWING_TIMEOUT_SECONDS_DEFAULT_VALUE;
		}
	}
A utility class to handle running code on the AWT Event Dispatch Thread
Ghidra/Framework/Utility/src/main/java/ghidra/util/Swing.java