Over a million developers have joined DZone.

Would Someone Consider To Use SWT (or another native widget library) Again These Days For Portable Platforms / Applications?

DZone's Guide to

Would Someone Consider To Use SWT (or another native widget library) Again These Days For Portable Platforms / Applications?

· Java Zone ·
Free Resource

Get the Edge with a Professional Java IDE. 30-day free trial.

Everything started with AWT in JDK 1.0. It came with JDK 1.0, and it used (actually uses—is still there) native widgets for rendering. I still remember the excitement, as it was introduced around 1998 (with JDK 1.2). Everyone was excited, although even the JTextFields weren't rendered correctly. Swing took the opposite approach—it rendered the components itself—so it was somehow OS independent. Only about three years later Eclipse was introduced with the SWT. It took a similar approach to AWT—because of the responsiveness problems of Swing and the native look and feel. At the time it was a viable solution for a given problem (although e.g. the performance of other Swing applications was really good). These days the responsiveness of Swing is just phenomenal (just ask IntelliJ / NetBeans users about it :-)), and Eclipse (forms) look very different to the native Windows applications (Outlook, Office, OneNote etc.). The new platforms like Flex, Silverlight, even Java FX, do not even try to achieve a perfect, native, look and feel—many nice demos just look totally different (which can be a good thing).

A native UI toolkit is harder to maintain for different platforms, because you have to test different operating systems (32 and 64 bits), and emulate some widgets, since they are not available for every given platform. So there is more effort to achieve the same goal (a decent toolkit). Furthermore, SWT can only wrap existing native widgets, so the usable API is somehow limited. It's not always fun to work with it. Just ask a developer (after a beer) with SWT / JFace experience, whether he/she really enjoys it. You will get interesting answers... :-).

Regarding the maintenance overhead and portability issues—it remains a really interesting question. Would e.g. Eclipse start with SWT again—or provide a lightweight alternative approach?

From: http://blog.adam-bien.com/

Get the Java IDE that understands code & makes developing enjoyable. Level up your code with IntelliJ IDEA. Download the free trial.


Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}