xhtml
 

Nesting Boxes

Suppose you want to form a layout something like this:

One Two Three Four Five
Tool A
Tool B
Tool C
Tool D
Drawing area
Status line

You should be able to visualise this as consisting of three components stacked into a vertical box.  The top one is a horizontal box of buttons, and the bottom one is the status line.  The middle component is a horizontal box of two components, the left one being a vertical box of tools.  Here is a program that's puts all this together, still using just buttons (a couple of them are increased in size, though).

NestingBoxes.java

This is rough and ready.  To fine tune box layouts, use a combination of library and tutorial documentation, e.g.:

Java Libraries: Box Class
Java Libraries: BoxLayout Class
Java Tutorial: Using Box Layout

Back