I’ve spent the last month getting to know SWT, and I’ve gotta say that I’ve written my last Swing app. After spending far too long messing with Swing MVC pattern and writing modeller code for my damn combo boxes, that’s it. I’ve had it. I’ve come to the conclusion that I’m just not smart enough to grok Swing.

But I was still missing a decent sized SWT app that would prove me to that humans could write SWT apps and that I could model off for my own mid-sized project. Then I had a good look at the source to RSSOwl - one very funky SWT RSS Reader - and I’m really starting to get a feel for SWT. Full kudos to those guys for putting together a very spunky app with a very nice source structure. One that I can pick up after a little digging and that looks very maintainable.

Booned to know that this thing looks good in the large, and to get a feel for SWT in the small, I ported a small Swing utility app that does some crypto stuff. It’s got a combo, couple of buttons, and couple of text fields to hold the input and output text. Total port time: 1.5 hours. In the process I managed to dump the two third party libs I was using to make the thing look good (JGoodies forms and JGoodies looks).

I initially did the layout with the SWT FormsLayout, and later made the switch to a straight SWT GridLayout since the overhead of layout data for FormsLayout was starting to urg me (and the layout was a simple grid anyways, really). The app was snappier to start up (half the time of the swing app on JDK 1.4.2 on Win32), and best of all looks completely native. Ran it through exe4j to get a nice little binary launcher and I was in business.

The only dramas I had was getting the form icon to look right (there still seems to be some issues with PNG transparency and SWT on Windows, and I couldn’t really be bothered converting things to GIFs so I’m just living with it).

So my take is that I’m ditching Swing and running with SWT for all further GUI jobs. The Layout managers are great, the widgets are native (and have simple APIs that I could use mainly from autocomplete), and the doco is abundant.

More info here when my experience grows, and my mid-sized project gets the facelift that I’ve been putting off. I gotta say, though, after my first experiences of a small port, SWT just gets me excited about the desktop again!