The code:
public class Try_Grow_01 {
public static void main(String[] args) {
JFrame frame = new JFrame();
frame.setLayout(new MigLayout("fill, debug", "[fill]5[5]"));
frame.add(new JButton("one"), "");
frame.add(new JButton("two"), "");
frame.add(new JButton("three"), "");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
}
result is
i.e. two right cells also grow, while I want them not to.
How to accomplish?
If you want the first cell grow and fill all available space then you must create the
MigLayout
as follows:If you want the first cell grow but without fill the available space then you must create the
MigLayout
as follows:Take a look to page 6 of Quick Start guide