MigLayout usage

This is pretty easy in MigLayout:

setLayout(new MigLayout("fill"));

add(new JButton("button 1"), "w 50%");
add(new JButton("button 2"), "w 50%, wrap");
add(new JButton("button 3"), "grow, push, span");

If you read pstanton's original question, I think the layout instructions required are very close to how he formulated it. That's what I like about MigLayout :)


I've never used miglayout, but it should be something like the following:

...
cp.add(new JButton("btn1"));
cp.add(new JButton("btn2"), "wrap");
cp.add(new JButton("btn3"), "span");
...