@Override
	public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {

		Rectangle borderR = new Rectangle(x + EDGE_SPACING, y + EDGE_SPACING,
			width - (EDGE_SPACING * 2), height - (EDGE_SPACING * 2));
		Insets borderInsets;
		if (border != null) {
			borderInsets = border.getBorderInsets(c);
		}
		else {
			borderInsets = new Insets(0, 0, 0, 0);
		}

		Rectangle rect = new Rectangle(x, y, width, height);
		Insets insets = getBorderInsets(c);
		Rectangle compR = getComponentRect(rect, insets);
		int diff;
		switch (titlePosition) {
			default:
			case ABOVE_TOP:
				diff = compR.height + TEXT_SPACING;
				borderR.y += diff;
				borderR.height -= diff;
				break;
			case TOP:
			case DEFAULT_POSITION:
				diff = insets.top / 2 - borderInsets.top - EDGE_SPACING;
				borderR.y += diff;
				borderR.height -= diff;
				break;
			case BELOW_TOP:
			case ABOVE_BOTTOM:
				break;
			case BOTTOM:
				diff = insets.bottom / 2 - borderInsets.bottom - EDGE_SPACING;
				borderR.height -= diff;
				break;
			case BELOW_BOTTOM:
				diff = compR.height + TEXT_SPACING;
				borderR.height -= diff;
				break;
		}
		border.paintBorder(c, g, borderR.x, borderR.y, borderR.width, borderR.height);
		Color col = g.getColor();
		g.setColor(c.getBackground());
		g.fillRect(compR.x, compR.y, compR.width, compR.height);
		g.setColor(col);
		component.repaint();
	}
A helper class to the InlineComponentTitledPanel that implements the component-in-border effect.
<p>
<b>This class should not be used outside InlineComponentTitledPanel.</b>
 @see docking.widgets.InlineComponentTitledPanel
Ghidra/Framework/Docking/src/main/java/docking/widgets/InlineComponentTitledBorder.java