Consider JGoodies Forms for layouts

One of the painful aspects of Swing is layouts. The layouts provided by the JDK are inadequate in many practical cases. The GridBagLayout class is particularly frustrating. Although its basic idea is sound, the details of its use are difficult and frustrating to master. As well, using GridBagLayout usually creates code repetition, which needs additional effort to reduce or eliminate.

As an alternative, you may consider the excellent JGoodies Forms tool. It takes the interesting approach of defining a small mini-language for defining its layouts (an example of a Domain Specific Language). While at first somewhat cryptic, this mini-language is quite effective in practice. The end result is almost always pleasing to the eye. Another nice feature is its debug mode, whereby a colored grid is laid over the form, so you may easily verify the x-y coordinates of its cells.

See Also :
Layout Managers