I've been working with Java for a long time now, and keep running into the same problem -- lack of a decent layout manager. I've tried the various IDE's, but found them incapable of producing an efficient and maintainable interface. For the most part, they are limited to the same old AWT layout managers and tend to produce inefficient and hard to follow code. Others use a proprietary language or file format to create the layout, which is difficult or impossible to maintain without using proprietary tools.

I've searched the internet for a decent layout manager, but haven't found one that is as flexible or powerful as GridBag. I have used GridBag a lot, I have yet to find a layout that GridBag is unable to handle. What I don't like about GridBag is that it is cumbersome to use.

I did find a TableLayout manager from Westhawk (www.westhawk.co.uk) that I liked and used a lot with Java 1.1.x, but for some reason it didn't work correctly with Java 2. Westhawk's TableLayout uses a simple constraint string that makes it real easy to create complex layouts. I was really disappointed to find that it had problems with Java 2. I started to look into the source code, and found it is very C-like and clearly shows its C origins. I thought, "Make your own!"

So I wrote the KappaLayout -- similar to the others, but this one's simpler, easier to use, flexible and as powerful as GridBag. I used several layouts for inspiration, notably GridBag and TableLayout, but also BoxLayout and Grid. I like the constraint string of TableLayout, but also like the flexibility and power of GridBagConstraints. I like the strut concept from Box, and the ability to make components (particularly buttons) the same size that Grid provides. KappaLayout incorporates all of these and improves and simplifies. KappaLayout's constraint string is more flexible than TableLayout, KappaLayout.Constraints is simpler and easier to use than GridBagConstraints.

There are actually two layout managers here, KappaLayout and LambdaLayout. LambdaLayout used the exact same constraint string as KappaLayout, but acts somewhat differently when a container is stretched. See the page for details of the differences between these.

SourceForge Logo