private List<ComponentInfo> findComponents(Container root) {
		List<ComponentInfo> infoList = new ArrayList<>();
		if (root == null) {
			return infoList;
		}
		ComponentInfo rootInfo = new ComponentInfo(null, root, 0);
		infoList.add(rootInfo);
		for (int i = 0; i < root.getComponentCount(); i++) {
			Component comp = root.getComponent(i);
			ComponentInfo info = new ComponentInfo(rootInfo, comp, i);
			infoList.add(info);
			addChildInfos(infoList, info);
		}

		return infoList;
	}
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