public static Window windowForComponent(Component c) {
		if (c == null) {
			return null;
		}

		if (c instanceof Window) {
			return (Window) c;
		}

		return SwingUtilities.getWindowAncestor(c);
	}
Returns the window parent of c.  If c is a window, then c is returned.

<P>Warning: this differs from {@link SwingUtilities#windowForComponent(Component)} in
that the latter method will not return the given component if it is a window.

@param c the component
@return the window
Ghidra/Framework/Generic/src/main/java/generic/util/WindowUtilities.java