« Late Binding is Swell, Late Typing is Groovy! | Main | Closures in Java: Too Much Typeing! »

Why Would a Groovy Swing Programmer Need a Matisse-like GUI Builder?

Geertjans been doing great things with Groovy and NetBeans.

Given how easy this all is in Groovy, I wonder whether the Groovy community even needs a Matisse-like GUI Builder. It all seems pretty intuitive, and with syntax coloring and code completion, plus maybe one or two other fun things (such as the Navigator shown above), coding Swing in Groovy is going to be a breeze.

Why would someone writing a GUI in Groovy need a Matisse-like GUI Builder? Layout. Specifically GroupLayout.

You can stop reading this blog entry here if you get it. I'm not likely to add anything informative to the Visual GUI Builder debate in this post. But in the end it's the same reason most people don't open up a text editor and write postscript and instead fire up Microsoft Wurd or something. (Can mis-spelling a word keep me from copyright infringement? We shall see.). Some things are just easier to see in a 2-D WYSYWIG format than in an essentially one dimensional coded representation of the same.

Geertjan's sample is deceptively simple. Why the widgets are nicely centered and separated is because the default layout of a Panel is FlowLayout. This is only really useful for simple GUI demonstrations and nested button panels anyway. What if you are doing an address form where the labels are all left aligned and the text fields all need to fill the same width (which is for most to the right edge of teh form), except for the checkbox on row 4 for suite number and the text field it enables below it (which needs to be indented and aligned with the checkbox text) and line 8 which is a North American 3-3-4 telephone number in separate text boxes, and all text labels and text boxes need to be baseline aligned, except for the action buttons that need to anchor to the south east on this resizable dialog. Oh, and follow the spacing guidelines from the Java Look and Feel as well.

This example may sound contrived, but it's not. Try codeing that by hand. Actually don't, I'm against self-inflicted pain. Boot up Netbeans, and use Matisse and the new Group Layout.

Comments (2)


Yeah, the real reason there aren't many gui builders made, especially for smaller languages like groovy or python or ruby, is that they are very difficult to do.

And the existing gui builders are almost entirely designed with one language in mind. We need something like QT designer or Sharpdevelop form designer for languages that run on the jvm.
I haven't looked at Matisse to see how easy it would be to adapt it to other languages.

Are you trying to only attract existing Swing builders to Groovy and/or Griffon, or are you hoping to attract new people who've never developed in Swing?

If you don't want your technology to eventually die, you need to attract the latter. And when you're in this latter group, let me tell you, a GUI builder really really helps.

Post a comment


This page contains a single entry from the blog posted on March 29, 2007 8:53 AM.

The previous post in this blog was Late Binding is Swell, Late Typing is Groovy!.

The next post in this blog is Closures in Java: Too Much Typeing!.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.33