• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need some basic swing help....

 
Ben Cramphorn
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic