!7 p-substance { JPanel panel = customLayoutPanel(func(Container parent) -> Dimension { Dimension size = parent.getSize(); int y = 10; for (Component c : parent.getComponents()) { int h = c.getPreferredSize().height; c.setBounds(10, y, size.width-20, h); y += h + 10; } ret componentsBoundingSize(parent, 10); }); for i to 10: panel.add(jtextfield()); showFrame(panel); }