InfoQ

InfoQ

News

My Bookmarks

Login or Register to enable bookmarks for unlimited time.

The content has been bookmarked!

There was an error bookmarking this content! Please retry.

Does Groovy need a GUI Builder

Posted by Rob Thornton on Mar 30, 2007

Sections
Development
Topics
Netbeans ,
Groovy ,
Java ,
JVM Languages ,
Dynamic Languages ,
Languages ,
Programming ,
Rich Client / Desktop

Geertjan is integrating Groovy support into NetBeans 6.0 and is impressed with the ease of writing Swing code in Groovy. He questions whether a Matisse-like GUI builder is necessary for Groovy. Danno Ferrin responds that layout, specifically GroupLayout is the reason.

Geertjan begins by throwing up a very simple UI and suggesting some simple pseudocode that most people, regardless of programming skill and experience, would be able to come up with. He then shows that you can take his pseudocode and paste it into a Groovy context, add a few lines to load the SwingBuilder, and get the simple UI expected. He then states:

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.

Mike A quickly commented that the example is very simple and doesn't discuss actions, events, data binding, etc. Danno Ferrin says that layout is the key piece missing from the example.

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 the form), except for the checkbox on row 4 for suite number.

His example is more complicated than shown here and he ends with the point that layout code is hard to write and that visual designers, such as Matisse, make the problem a lot easier to handle.

  • This article is part of a featured topic series on Java
People don't waste time building GUI by Felipe Cruz Posted
Re: People don't waste time building GUI by Andres Almiray Posted
Re: People don't waste time building GUI by Felipe Cruz Posted
Down with the GUI builders by Robert McIntosh Posted
Re: Down with the GUI builders by Felipe Cruz Posted
Re: Down with the GUI builders by Stefan Kleine Stegemann Posted
What GUI Builders are? by Robert Thomas Posted
  1. Back to top

    People don't waste time building GUI

    by Felipe Cruz

    Groovy need a GUI builder.

    But in my opinion, the point is that today people don't want to waste time building GUI and not if the code is simple or not..

  2. Back to top

    Re: People don't waste time building GUI

    by Andres Almiray

    Felipe, you're right, not many will like to "waste time" coding UIs, but the truth is that there will be cases where generating a panel dynamically will be easier with something like Groovy's closures and builders.

    PS: did you study at ITESM ?

  3. Back to top

    Re: People don't waste time building GUI

    by Felipe Cruz

    Agree with you.. groovy can help a lot when building dynamic GUI stuff

    I did not study at ITESM.

  4. Back to top

    Down with the GUI builders

    by Robert McIntosh

    I have yet to see a GUI builder that built a decent looking UI. Anyone who uses such a tool probably doesn't care about how their UIs look. Besides, in most cases a good coder can hand build a good UI in roughly the same time as someone futzing with a builder tool.

  5. Back to top

    Re: Down with the GUI builders

    by Felipe Cruz

    NetBeans Matisse?

    A good coder with a good UI builder can build much more faster than a good coder without...

  6. Back to top

    Re: Down with the GUI builders

    by Stefan Kleine Stegemann

    As a frequent user of Apple's Interface Builder I really can't believe why people are questioning the need for a GUI builder. Writing GUI code is just booooring. Good coders won't even think about wasting their time with writing GUI code unless they have to because of the lack of good tools. I really wonder why there isn't any GUI builder for Java that catches up with Interface Builder or even the old Delphi GUI builder.

  7. Back to top

    What GUI Builders are?

    by Robert Thomas

    We need more that drag & drop forms. We need higher abstraction: ui-pattern validation, use case validation, easy control integration, etc.

    I'm really looking forward what these guys from Himalia are doing for Visual Studio right now. I think they will move to the Java platform when if pass the alpha version ;)
    At least, their technology is platform independent...

    Really, I think they are in the right direction, nowadays UI building is obsolote and doesn't scale.