public static String getTitleForWindow(Window window) {
		if (window instanceof Frame) {
			return ((Frame) window).getTitle();
		}
		else if (window instanceof Dialog) {
			return ((Dialog) window).getTitle();
		}
		return null;
	}
A convenience method to close all of the windows and frames that the current Java
windowing environment knows about
Ghidra/Framework/Docking/src/main/java/docking/test/AbstractDockingTest.java