jasper01
asked on
Layout Manager Question
Hi
I am having a problem getting my layout correct, the GUI I want to create should look something like the following:
__________________________ ___
|_________________________ ____|
| _________....._____....... .......... .......... ..|
||.....................|.. .|_____|.. ..Label... .......... .| <-- TextField
||.....................|.. .......... .......... .......... .......... ...|
||.....................|.. .......... .......... .......... .......... ...|
||.....................|.. .._____... .......... .......... ......|
||_________|...|_____|.... .......... .......... ....| <-- Button
|_________________________ ____|
I have the list box created and displayed fine but and have created a panel to store the TextField, Label and Button as follows:
panel2.add(testName);
panel2.add(new JLabel("# of records");
panel2.add(runButton);
This gives me the three in a row ... any ideas as to what layou manager to use and how to put in gaps between them .... I've played about with a few managers but am ending up scrapping it and restarting as it's not doing what I need!
Some code snippets, or tips would be really appreciated!
Thanks
J
PS sorry about the dots but spaces wrecked the layout!
I am having a problem getting my layout correct, the GUI I want to create should look something like the following:
__________________________
|_________________________
| _________....._____.......
||.....................|..
||.....................|..
||.....................|..
||.....................|..
||_________|...|_____|....
|_________________________
I have the list box created and displayed fine but and have created a panel to store the TextField, Label and Button as follows:
panel2.add(testName);
panel2.add(new JLabel("# of records");
panel2.add(runButton);
This gives me the three in a row ... any ideas as to what layou manager to use and how to put in gaps between them .... I've played about with a few managers but am ending up scrapping it and restarting as it's not doing what I need!
Some code snippets, or tips would be really appreciated!
Thanks
J
PS sorry about the dots but spaces wrecked the layout!
I think the best layout is the gridbaglayout which gives you a lot of options, but it's a little more complex than the rest.
USe null layout manager or XYLayout in JBuilder/Jdeveloper
btw: visit my site
www.xanga.com/goldwarlock
www.xanga.com/goldwarlock
You could use a Box and BoxLayout.
This allows you to create "glue", "struts" and "rigid areas" within the box to space out your components.
This allows you to create "glue", "struts" and "rigid areas" within the box to space out your components.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You try Absolute positioning with null Layout,..or u can simply make that to Box Layout nd fit in a BorderLayout West part.
If your application doesnt need to be resized automatiacally use GridBack (that's pane)
THEN use null layout or XYLayout
THEN use null layout or XYLayout