mig layout - span and grow/push problem

Posted by pstanton on Stack Overflow See other posts from Stack Overflow or by pstanton
Published on 2010-04-26T07:57:32Z Indexed on 2010/04/26 8:03 UTC
Read the original article Hit count: 287

Filed under:
|
|

i want 3 components laid out on 2 lines, so that the bottom component and the top-right component use all available horizontal space.

JFrame frame = new JFrame();
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.setLayout(new MigLayout("debug, fill"));
Container cp = frame.getContentPane();
cp.add(new JTextField("component 1"), "");
cp.add(new JTextField("component 2"), "growx,push,wrap");
cp.add(new JTextField("component 3"), "span,growx,push");
frame.pack();
frame.setVisible(true);

considering the above, how do i stop the space between "component 1" and "component 2" from appearing when resizing the frame?

http://migcalendar.com/forum/download/file.php?id=204&sid=20058cd9cefec7a53f4f8fd03fca08f4

thanks.

© Stack Overflow or respective owner

Related posts about java

Related posts about swing