private Container findRoot(Component component) {
		if (component.getParent() == null) {
			return component instanceof Container ? (Container) component : null;
		}
		if (component instanceof Window window) {
			return window;
		}
		return findRoot(component.getParent());
	}
Diagnostic dialog for display information about the components in a window and related focus
information.
Ghidra/Framework/Docking/src/main/java/ghidra/docking/util/ComponentInfoDialog.java