• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

What SWT is missing and other thoughts

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
author
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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...
 
Thomas Boshell
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
You are HERE! The other map is obviously wrong. Better confirm with this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic