@Override
	public void layoutContainer(Container parent) {
		int componentCount = parent.getComponentCount();
		int rowCount = (componentCount + (columnCount - 1)) / columnCount;
		Dimension d = parent.getSize();
		Insets insets = parent.getInsets();
		int width = d.width - (insets.left + insets.right);
		int totalColumns = Math.min(columnCount, componentCount);
		int availableColumnWidth = (width - (columnCount - 1) * hgap) / totalColumns;
		int columnWidth = getColumnWidth(parent, availableColumnWidth);
		int y = insets.top;
		for (int i = 0; i < rowCount; i++) {
			int x = insets.left;
			int rowHeight = getRowHeight(parent, i);
			for (int j = 0; j < columnCount; j++) {
				int ordinal = i * columnCount + j;
				if (ordinal >= componentCount) {
					// this implies uneven components (can't fill the last row)
					break;
				}
				Component component = parent.getComponent(ordinal);
				component.setBounds(x, y, columnWidth, rowHeight);
				x += columnWidth + hgap;
			}
			y += rowHeight + vgap;
		}
	}
Constructs a new PairLayout.
@param vgap the gap (in pixels) between rows.
@param hgap the gap (in pixels) between the two columns.
@param columnCount the number of columns in this grid
Ghidra/Framework/Gui/src/main/java/ghidra/util/layout/VariableRowHeightGridLayout.java