This is how I'd do it, but it may not be the ideal way -- I have a background in postscript and html coding, so i tend to build things up using tables (in this case i'm going to use a box to accomplish the same thing) as a way of formatting. I find this to be pretty flexible:
...
...
Box hbLine1 = Box.createHorizontalBox();
Box hbLine2 = Box.createHorizontalBox();
Box vBox = Box.createVerticalBox();
hbLine1.add(new JLabel("blah"));
hbLine2.add(new JTextField());
hbLine2.add(new JButton("Click Me"));
vBox.add(hbLine1);
vBox.add(hbLine2);
...
...
Now your vBox contains the configuration of controls in the way you want it ... just by adding your vBox, regardless of layout, the components will be placed like you describe, so you can use whatever layout makes since for you -- for example you could add the vBox to the CENTER of the BorderLayout
Hope That Helps
Regards,
Meredith Shaebanyan
|