Skip to main content

Layout Manager Showdown

Posted by joconner on October 11, 2006 at 1:42 AM PDT

My recent blog about NetBeans GUI Builder (Matisse) and GroupLayout have encouraged a vigorous debate. Except for a fertile forum for comments, I've contributed practically nothing to the conversation and I feel somewhat intimidated by the brain power and energy that go into the discussions. However, having been encouraged by the participants, I'm announcing a Layout Manager Showdown!.

Several UI power thinkers have agreed to present their arguments for their favorite layout manager. Each researcher will provide his/her analysis of a manager and his best solution for creating forms and panels. They will present their findings so that others can compare and contrast the various layout managers available to the Java community.

At this point I have the following layout managers and researchers on the showdown roster:

Layout Manager Researcher
MigLayout Mikael Grev
FormLayout ??
ZoneLayout bnahas
PageLayout varan
TableLayout ??
GroupLayout ??

Are you interested in one of these layout managers? If so, speak up, and I'll add you to my list of suckers, er...researchers. I'm just joking about the "suckers" part, but I'm glad it's you writing up the analysis and not me. I don't have enough willpower to learn a half dozen new layout managers on my own, but I'll be happy to learn from you! And I'll probably use your layout manager if it's really good.

There are still a few things to determine before we can do this in an orderly way.

  1. Where will we put this information?
  2. What forms or panels should we implement?
  3. What are the evaluation criteria?

I'll take a poke at answering these:

  1. I would like to suggest the wiki right here at In fact, there is already a 3rdParty Layout Manager comparison page on the Java Desktop Home wiki page.
  2. You could get started with the frame shown below...
  3. I'd like to know about some of these items:
    • Can it align components across other components? For example, can it both left and right align the 'phone' text field with the 'city' text field on the other side of the two address fields?
    • Does your manager know about platform specific gaps and spacing among components. Just curious.
    • Can the text fields, labels, etc grow and shrink when the text is localized?
    • Just how much code do I have to write? Java code? Declarative XML?
    • Can I nest panels?
    • Can it align components along a baseline. For example, the new GroupLayout can align labels and text fields along the text baseline...that's nice.
    • What's the licensing?
    • Will this work for bi-directional locales? How difficult would it be to mirror the layout for a right-to-left locale?
    • What else should we evaluate?

Hey, I don't want to hold anything up, so why don't you get started with the address book frame here. You don't have to fill in any data...just create this layout. Here are some more details about the frame below:

  • The 'Last Name', 'Phone', etc, 'Country' labels are right a column, maybe, but that's up to you.
  • The text fields for last name, phone, etc through country are left aligned.
  • All text fields and the list at the left should expand horizontally and get equal amounts of the additional space.
  • Labels and text fields are aligned along the text baselines.
  • The list should also expand vertically.
  • Keep the row of buttons immediately under the address information even if the the list expands vertically when you resize.


Go ahead. Use your favorite layout manager to create this frame, and let us know when we should go take a look at your solution and comments.

Related Topics >>