aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Need some basic swing help.... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Need some basic swing help...." Watch "Need some basic swing help...." New topic
Author

Need some basic swing help....

Ben Cramphorn
Greenhorn

Joined: May 13, 2004
Posts: 17
Basically want to add an additional label to a gui of mine. I currently have a Jpanel with box layout. Added two components, a small button panel and a table at the bottom.

What I need to do is to add a label with some text and instructions on the left hand side of the button panel but for some reason it keeps on messing up and going ontop of the button panel instead of next to it. Here is my code...

http://www.rafb.net/paste/results/1HRn2O75.html

What I want is for the final appearence to look like this...



Any ideas? Also I need to keep a border of 10 between all items and need to keep the beveled outline.

Hope you can help?

Thanks..
Joe Vahabzadeh
Ranch Hand

Joined: Jan 05, 2005
Posts: 140
I think this would be easiest using Border Layout.

Let's say create a few JPanels:

Main
Top
Instruction
ButtonHolder

Add your text to Instruction, add your buttons to ButtonHolder.

set Top to Border Layout. Add Instruction to the CENTER section of Top, add ButtonHolder to the LINE_END section of Top.

Add Top to the PAGE_START section of Main.

Add Table to the CENTER section of Main.

Set margins, etc., as you do currently to keep the spacing the way you like it.

That should give you what you need.
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need some basic swing help....