The following is close to what I want, and does what I expect:
import javax.swing.JComboBox;
import javax.swing.JPanel;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
import net.miginfocom.swing.MigLayout;
public class MigBug extends JFrame {
public static void main(String args[]) {
MigBug migbug = new MigBug();
migbug.pack();
migbug.setVisible(true);
}
public MigBug() {
JPanel content = new JPanel();
content.setLayout(new MigLayout("fill, debug"));
content.add(new JLabel("Label 1"));
content.add(new JComboBox());
content.add(new JLabel("Label 2"));
content.add(new JTextField(25), "growx, wrap");
content.add(new JLabel("BIG"), "span, w :400:, h :200:, growy");
setContentPane(content);
}
}
However, if I make the following change:
content.add(new JLabel("BIG"), "span, w :400:, h :200:, grow");
ie. Change the spanned component to grow in x as well as y, the Label 1 cell grows in x, even though it shouldn't.
Does anyone know a way I can get round this?