!7 p-substance { JPanel panel = new JPanel(new AbstractLayoutManager { public void layoutContainer(Container parent) { 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; } preferredSize = componentsBoundingSize(parent, 10); } }); for i to 10: panel.add(jtextfield()); print("components added"); showFrame(panel); }