private static final int getComponentIndex(Component component) {
		if (component != null && component.getParent() != null) {
			Container c = component.getParent();
			for (int i = 0; i < c.getComponentCount(); i++) {
				if (c.getComponent(i) == component) {
					return i;
				}
			}
		}

		return -1;
	}
Create a panel with <code>titleComponent</code> in the prescribed location with a secondary
 border
@param titleComponent widget to draw in the border
@param titleJustification top-bottom alignment
@param titlePosition left-right alignment
@param otherBorder secondary border to place around this panel
@see TitledBorder
Ghidra/Framework/Docking/src/main/java/docking/widgets/InlineComponentTitledPanel.java