aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes What SWT is missing and other thoughts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "What SWT is missing and other thoughts" Watch "What SWT is missing and other thoughts" New topic
Author

What SWT is missing and other thoughts

Thomas Boshell
Greenhorn

Joined: Jul 07, 2004
Posts: 3
The thing I like most about Swing is the amount of documentation, tutorials, and examples. True, Swing has been around longer, but the documentation really helps and it is easily accessable. I have looked into trying out SWT and decided to look through documentations and was a bit dissappointed. I had the feeling that most of my time would be spent on looking for the documents. Maybe I have become a bit too used to having the JavaDocs and standard tutorials readily accessible. There is also a wealth of advanced articles on Swing development. But for SWT I mainly see the equivalent of "Hello World" examples. Sure that is a great way to start but is a bit lacking.

Then for the longest the SWT library had been primarily for Windows. I have heard that it now functions on Linux, but it matured in Windows. That held me back for a while from taking it too seriously, now I am taking it serious. Eclipse looks great.

Another thing that I have read about is that SWT does not really embrase the MVC convention. That at times it becomes a real hassel to have the view objects work with the data. I have a Swing app that I have been developing that performs a lot of work with tables and if I could not control the table the way I need to then it is of no value to me. I did try (I think I was using version 2.something) to develop a plug-in as a quick test and had a frustrating time with where I wanted the table...I wanted the table as a editor but could never get it recognized as an editor (center area). Frustrating. That is the advantage that I see with Swing, I can modify the controls the way I need them and can in effect create any type of new control that my heart desires. It is all about making new controls.

In conclusion I can say that I am divided. Swing I can control in ways that I have not seen in SWT. SWT looks better. Swing has more documentation. I have not really noticed any performace problems with SWT, but in Swing's defense a slow Swing program is a good sign of some lazy programming.
Rob Warner
author
Ranch Hand

Joined: Apr 22, 2004
Posts: 50
You're right about the relative lack of SWT documentation; that was what drove me to write this book. I found the technology so compelling that I couldn't abandon it, but knew that many others, like me, would want something more substantial that a few articles and some snippets. That's the void I hope to fill with this book; it remains to be seen how well I've filled it

SWT doesn't embrace MVC: it's an API that talks to the raw widgets. JFace, however, DOES embrace MVC. Think of it as an MVC layer that sits on top of SWT. The book goes into these differences, and explains how to leverage JFace.

True, Swing has many more custom widgets, but you actually can embed these into SWT apps--or you can rewrite them in SWT
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
Originally posted by Rob Warner:
True, Swing has many more custom widgets, but you actually can embed these into SWT apps--or you can rewrite them in SWT


Oh, it's amazing! Can we embed Swing widgets into SWT apps? Will they work well together? I've never known it before. I just think that SWT must be developed with its own library and its widgets only... But now I can see that they can be developed to work together...

Does your book discuss about this? As far as I see in the TOC of the book, I cannot find any chapter that discusses this issue... Thanks...


Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
Thomas Boshell
Greenhorn

Joined: Jul 07, 2004
Posts: 3
embedding Swing in SWT. Could be a possibility. I know the problems with mixing Swing and AWT, heavyweight and lightweight controls. I love the arguements that Sun uses against SWT. I think it makes them nervous. They argued the point that it did not make any sense for IBM to develop SWT (uses native object like AWT but only better, maybe one could say correctly?) since they helped to develop Swing as a replacement for the limitations for AWT. But then I did some thinking on it and decided that it is not a problem if they did it correctly, which it looks like they did. Now to the question, if one mixes Swing and SWT together (also possible with Swing and AWT but not advisable) what possible problems must one be aware of?
Rob Warner
author
Ranch Hand

Joined: Apr 22, 2004
Posts: 50
The book does not cover this, but it's quite simple to do. Here's a snippet that demonstrates how to do it.

I haven't played with this much yet, and haven't seen any downsides (yet).
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Seems pointless to me to embed Swing in SWT. Why not just Swing all the way? Now the other way around makes more sense. Using SWT's File Chooser so you get the native chooser instead of Swings. Now that would make sense. Buttons and ComboBoxes and Labels, et al, who cares.


GenRocket - Experts at Building Test Data
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What SWT is missing and other thoughts