since 1999

 

2 minutes estimated reading time.

SWT and Swing in the News, Again.

It seems that the SWT vs. Swing is back in the news. Maybe it has never gone away but I have simply not noticed it as most of my work in the last year has either been doing packet inspection with C or simple scripting - aka no significant Java work.

On the Thought: Gosling on SWT, “…Gosling says AWT == SWT. That’s sort of true but less true than more. The big difference between the two is AWT is very much least-common-denominator across all platforms. SWT isn’t. The other significant difference is AWT chose to hide the emulation layer in C. In other words, java.awt.Button is the same on all platforms, while the native peer differs on each platform. One of the consequences of this is porting is harder, some things are in Java, some aren’t. It also makes for a larger footprint because a java.awt.Button has fields for it’s size, bounds, etc that the OS also has….”

It seems that the primary argument against Swing is that it is slow and not true to its host platform. It also seems that the primary strength of SWT is also its weakness as it has to maintain multiple native implementations for the same functionality.

I came across an interesting article in OS News on a “SWT vs. Swing” which appears to be worth the read. “…over the relative merits of SWT and Swing." Of course you may want to see the OS news comments on the topic.

I suspect I will be finding this topic of more interest if and when I start working on Java-based GUI applications more. I happen to like both Eclipse and NetBeans as Java development environments; even though gvim also works.

Of course QT is also very impressive and may not be a bad choice at all for building cross-platform software which targets Windows, Mac, and BSD/Linux.