Dimension getPreferredSize(Container parent) {
		Insets insets = parent.getInsets();
		int n = parent.getComponentCount();

		if (n <= 0) {
			return new Dimension(insets.left + insets.right, insets.top + insets.bottom);
		}

		int width = 0;
		int height = 0;
		for (int i = 0; i < n; i++) {
			Component c = parent.getComponent(i);
			Dimension d = c.getPreferredSize();
			height = Math.max(height, d.height);
			width += d.width;
		}

		return new Dimension(width + insets.left + insets.right,
			height + insets.top + insets.bottom);
	}
@see javax.swing.Scrollable#getScrollableUnitIncrement(java.awt.Rectangle, int, int)
Ghidra/Framework/Docking/src/main/java/docking/widgets/VariableHeightPanel.java