@Override
	public Dimension preferredLayoutSize(Container container) {
		Component[] components = container.getComponents();
		if (components.length == 0) {
			return new Dimension(0, 0);
		}
		int width = hGap;
		int height = 0;

		for (int i = 0; i < 2 && i < components.length; i++) {
			Component component = components[i];
			Dimension dim = component.getPreferredSize();
			width = width + dim.width;
			height = Math.max(height, dim.height);
		}

		Insets insets = container.getInsets();
		width += insets.left + insets.right;
		height += insets.top + insets.bottom;
		return new Dimension(width, height);
	}
Layout for two components laid out horizontally where the first component gets its preferred width
and the second component gets the remaining space up to its preferred width.
Ghidra/Framework/Gui/src/main/java/ghidra/util/layout/RightSidedSquishyBuddyLayout.java