Swing vs. SWT

I am blogging at Moscone, waiting for our i18n BOF session to start...

One of the interesting sessions I saw today was the Swing vs SWT panel session (well, title may be different, but something like that). Both creators of Swing and SWT were there, and gave their toolkit explanation in 10 minutes, and then the users for those toolkits (NetBeans for Swing, and another IDE for SWT) expressed how they think about those toolkits. After that, they answered the attendee's questions and they went into an endless battle, well not really.

I expected more like a heated battle, but it was kind of a cooperative discussion. One phrase they said that I liked most was something like, "The concepts of those toolkits are different, Swing focuses on the cross platform compatibility, on the other hand, SWT focuses on exploitation of the native platform functionality. They are complementary to each other." I think this explains all and let the developers decide which toolkit they think it is suitable for their applications.


SWT is a much better AWT. If it were not for backwards compatibility requirements, Sun and IBM could get together and make a new "swing" tossing out AWT, SWT and leaving Swing built as the full UI from the groud up using SWT where its applicable, and Swing on top to provide the existing Swing apps the ability to still work. It's really a shame they don't spend their resources for JDK 1.6 to do just this! I am all for SWT and Swing as they are both fueling each other to be better. JDK 1.5 has given 20+% performance on Swing, partly due to the competition with SWT. Still, I would rather see one UI API for all of Java that is better than or equal to the sum of SWT/AWT/Swing. It would make it easier to find developers for the one GUI kit instead of having a hard time finding SWT developers, or sometimes, the other way around. The primary reason I dont develop plugins for Eclipse is having to learn SWT. Even though they have Swing in a SWT widget, I dont want to bother.

Posted by Kevin on July 01, 2004 at 02:18 PM PDT #

I think one of the good things that SWT has is that its peerless architecture. We could do such things without throwing out AWT, but just re-implementing it by moving all the widgets up to java level. In fact on Unix, we introduced XAWT, which eliminates all the dependency on Motif widgets/Xt toolkit, and we've got much better performance than the traditional Motif based AWT implementation. Why not we could do on Windows?

Posted by Naoto Sato on July 01, 2004 at 05:22 PM PDT #

Dream on. Sun has "not invented here" big time. They could NEVER accept a widget toolkit that they didn't write, let alone an open source one.

Posted by karl on July 06, 2004 at 04:11 AM PDT #

Karl, what you wrote is not quite right. Solaris (and JDS , of course) includes Gnome Desktop/GTK+ Toolkit.

Posted by Naoto Sato on July 06, 2004 at 06:14 AM PDT #

Sorry, Java has "not invented here".

Posted by karl on July 08, 2004 at 10:55 PM PDT #

I am sorry, but I still do not understand your point. In fact, the Swing toolkit was initially developed not only by Sun itself, but also with Netscape's IFC team. Take a look at the following page: http://java.sun.com/developer/community/chat/JavaLive/1997/jl0708.html

Posted by Naoto Sato on July 09, 2004 at 04:57 PM PDT #

The IFC code was thrown in the garbage and rewritten, ask anyone from Netscape. Also, in this years Fireside chat, Gosling seems to think IBM had something to do with it.

Posted by karl on July 16, 2004 at 03:31 AM PDT #

I don't know whether the current implementation still contains Netscape's IFC code or not, or the Gosling/IBM thing, but one thing I can say is that Swing still claims that the Swing toolkit is a cooperative effort between Sun and Netscape. Take a look at the "About..." dialog in the SwingSet2 demo. I just argued your point that Sun has "NIH syndrome". Well, maybe I should stop here...

Posted by Naoto Sato on July 16, 2004 at 04:25 AM PDT #

Ever been involved in a JSR? My God what a ton of work! People bend over backwards for Java. One day they will stop.

Posted by karl on July 22, 2004 at 09:48 PM PDT #

Yes, I have. However, contrary to what you have wrote, I felt that the all the work was required to reach a consensus among the interested parties. If you still think there is something JCP could do better, please send your comments to the appropriate JCP contact, since this is already out of this entry's scope.

Posted by Naoto Sato on July 24, 2004 at 03:48 AM PDT #

SWT is just what SWING is not: It´s perfect for non-professional desktop applications; Look at Azureus: A perfect example of what SWING never was or will be. Except for memory consumption you will not notice a difference to other applications (and for Windows, .NET applications are memory-heavy as well).

Posted by Patrick Schriner on August 06, 2004 at 09:04 PM PDT #

I remember that that was a part of the discussion at the JavaOne session. Swing team was aware of the importance of the seamless integration to the underlying platform and has been trying to improve this. For example, with the Windows XP look and feel, users would hardly notice that it is a Swing application, unless s/he sees the coffee cup system icon at the top left corner of the application frame.

Posted by Naoto Sato on August 07, 2004 at 09:43 AM PDT #

No matter what the Swing team does, they will always be an emulation. They will never be quite right. It's just too hard to fake it, especially when it changes all the time.

Posted by lippy on August 08, 2004 at 01:20 AM PDT #

Post a Comment:
Comments are closed for this entry.



« July 2016

No bookmarks in folder