Thursday, July 05, 2007

[Tech] Layout Management desperation

Creating professional Swing applications can often be very tricky. It depends on developers preferences whether he uses an IDE to create a GUI or doing this by hand. I have found a funny video dealing with coding a GridBag layout manager. This video demonstrates how frustrating it can be, if you program your GUI by hand. At this point it is hard to say which approach is best for you. Take an IDE, for instance JFormDesigner, or Matisse, providing an easy to use user interface. Developers create their GUI by drag & drop components from the toolbar to their form. Behind the IDE generates the associated Java source code for all forms. That's fun. Some tools also provide reversal update, meaning when you change your source code, the GUI design will be also updated.

There are nice frameworks out there, e.g. Spring Rich Client, providing powerful utility classes for layout GUI forms. I developed several Swing projects using JGoodies form layout and some other useful technologies, where I intentionally create the GUI by hand. In my opinion creating GUI code by hand also has several advantages:
  • You learn how to deal with layout managers (Flow layout, Grid Bag, and so on)
  • A GUI creator can't handle everything (e.g. event handling)
  • An IDE created code is often hard to read
  • A developer must not learn an IDE (e.g. Netbeans) to develop Swing applications. I point this because I prefer Eclipse, but Netbeans provide better support for GUI development
Finally it depends on the preferences of a developer how to develop GUIs. Check out this cool video, and remember: "Swing also Rocks without GUI IDE".

1 comment:

Alexander Schatten said...

I personally have to say, that I have no good experiences with GUI builders. Typically you get "nice" results quickly, but the generated code tends to be quirky and often very hard to maintain.

Additionally, GUI build tools entrap the developer to make inproper design, creating huge spaghetti monsters, where visual code, event handler and business logic is mixed up in worst Visual Basic/Delphi style.

So I personally can recommend GUI builders exclusively to very experienced developers, that have a precise overview on how GUI building works manually and who figure to be more productive with such a tool knowing what the tool is actually doing.

Btw: this is similar to the visual HTML tools that were so fashionable some years ago (Dreamweaver and the like). Now meanwhile: which professional web-developer is still using Dreamweaver? It is still installed on my Mac, but opened maybe twice a year...