Jump to: navigation, search

Difference between revisions of "FAQ Is SWT better than Swing?"

m
(Link Swing to Wikipedia)
 
(One intermediate revision by the same user not shown)
Line 3: Line 3:
 
you are holding a nail or a screw.   
 
you are holding a nail or a screw.   
  
SWT and Swing are different tools that
+
[[SWT]] and [https://secure.wikimedia.org/wikipedia/en/wiki/Swing_%28Java%29 Swing] are different tools that
 
were built with different goals in mind.  The purpose of SWT is to provide
 
were built with different goals in mind.  The purpose of SWT is to provide
 
a common API for accessing native widgets across a spectrum of platforms.
 
a common API for accessing native widgets across a spectrum of platforms.

Latest revision as of 05:50, 29 October 2010

This is equivalent to asking whether a hammer is better than a screwdriver. The answer, of course, depends on whether you are holding a nail or a screw.

SWT and Swing are different tools that were built with different goals in mind. The purpose of SWT is to provide a common API for accessing native widgets across a spectrum of platforms. The primary design goals are high performance, native look and feel, and deep platform integration. Swing, on the other hand, is designed to allow for a highly customizable look and feel that is common across all platforms.

The answer to which is better for your application depends on which of these trade-offs you and your customers prefer. Do you want an application that looks the same on all platforms or one that looks and behaves like other applications on each of the platforms it is running on?

Of course, a hammer wielded with sufficient force can probably drive a screw into a wall, and the butt of a screwdriver can be used in a pinch to knock in a nail. However, a good carpenter keeps both hammers and screwdrivers in her tool box and will use the tool that is appropriate for the job at hand.

See Also:

FAQ How do I embed AWT and Swing inside SWT?


This FAQ was originally published in Official Eclipse 3.0 FAQs. Copyright 2004, Pearson Education, Inc. All rights reserved. This text is made available here under the terms of the Eclipse Public License v1.0.