!7 static L sentences; p { sentences = toLinesFullTrim(loadSnippet(#1008606)); sentences = notStartingWith("\"", sentences); JPanel panel = customLayoutPanel_trackWidth(func(Container parent) { int cols = 2, gap = 10; Dimension size = parent.getSize(); int w = max(100, size.width)-gap*2; int y = gap; LL rows = groupInFixedSizeRows(parent.getComponents(), cols); new L colWidths; for i to cols: colWidths.add((i+1)*w/cols-i*w/cols); for (L row : rows) { int h = 0, x = gap; for (Component c : row) h = max(h, c.getPreferredSize().height); for i over row: { row.get(i).setBounds(x, y, colWidths.get(i)-gap, h); x += colWidths.get(i); } y += h + gap; } ret componentsBoundingSize(parent, gap); }); for (S s : takeFirst(10, sentences)) { panel.add(jlabel("Sentence")); panel.add(jlabel("Action")); panel.add(jtextfield(s)); panel.add(jtextfield("screw it")); } //showFrame(panel); showFrame(jscroll(panel)); //showFrame(jscroll_centered(panel)); }