int (List<? extends Component> list, int y, int width, Insets insets) { int gap = myGap.get(); for (Component component : list) { if (component.isVisible()) { Dimension size = LayoutUtil.getPreferredSize(component); int x = 0; if (myAlignment == FILL) { size.width = width; } else if (myAlignment != SwingConstants.LEFT) { x = width - size.width; if (myAlignment == SwingConstants.CENTER) { x /= 2; } } component.setBounds(x + insets.left, y + insets.top, size.width, size.height); y += size.height + gap; } } return y; }