Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

SWT: Advantages and Disadvantages  RSS feed

 
RAVI KIRAN CHAMARTHY
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SWT is an API provided with IBM which says you can develop complex GUI based applications.
Can anybody please list out the advantages and disadvantages of using SWT over SWING.
Please let me know for any additional information.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm giving a presentation on this exact topic this Sunday! If you're in the Minneapolis/St.Paul area check out the MITSPO website for directions.

Here's the short answer.

SWT loads faster and seems to react quite a bit snappier than Swing... The difference is pretty noticeable on older hardware (like my 450Mhz machine at home), but on newer hardware (like my 1.7 GHz machine at work) the difference isn't that big.

The memory footprint can be smaller for SWT because a lot of it is in shared libraries. Every time a new Swing app launches, if the app launches a new JVM, the Swing classes get loaded into memory every time. The shared library only loads once for all SWT apps.
One thing many people like about SWT is that it has exact platform look and feel. SWT uses the native API to generate GUIs. Swing basically just gets a native canvas and draws all widgets on top of it. This means that an SWT app will look just like a Windows XP app when it runs on XP. If you have a skinnable desktop (like XP or GTK on linux) SWT even picks up the skinned look! However, if you want a custom look and feel for your app, you're going to have to use Swing.

Another thing to note is that SWT is only distributed with Eclipse, and requires shared libraries and JAR files specific to the platform. Swing is distributed with the JRE. If you are planning on distributing your application widely, this will make it more difficult.
 
RAVI KIRAN CHAMARTHY
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That was great. Thanks a lot. I cannot attend your presentation as I am in India.
Thanks once again,
Ravi
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!