Standard widget toolkit

from Wikipedia, the free encyclopedia
Standard widget toolkit
Basic data

developer Eclipse Foundation
Current  version 4.15
(March 5th, 2020)
operating system platform independent
programming language Java
category GUI toolkit
License Eclipse Public License

The Standard Widget Toolkit ( SWT ) is a GUI toolkit for creating graphical interfaces with Java .


SWT was developed by IBM in 2001 for the Eclipse development environment and is continuously updated. In contrast to Swing, SWT uses the native graphic elements of the operating system - such as the AWT from Sun - and thus enables programs to be created that have an appearance comparable to "native" programs.

However, SWT suffers from efficiency problems on some non-Windows platforms, as it requires many features of a basic toolkit, which - if not available - must be emulated (e.g. Z-order on GTK + ). In addition, the SWT libraries are not available by default on the executing system and must be supplied with the application while Swing component of the Java Runtime Environment ( Java Runtime Environment , JRE) is.

With SWT, native widgets are integrated by thin wrappers instead of outsourcing parts of the functionality to native peer classes. Because of the use of these resources, the SWT elements are called "heavyweight" as opposed to the "lightweight" components of the swing technique, which creates all of the graphic elements itself.

SWT is used in a number of applications, such as Eclipse itself, Vuze and RSSOwl .


SWT was developed as a more responsive and compact competitor to Swing. However, performance comparisons show that SWT is no faster than Swing and that the results depend heavily on the context and the test environment.


The GUI toolkit JFace uses the basic components supplied by SWT to assemble more complex widgets and provides an abstraction layer (viewer) for accessing the components. JFace makes it much easier to develop SWT-based desktop applications. The main classes of JFace are:

  • Viewers for connecting GUI elements to the data model
  • Actions to decouple GUI events and the action to be carried out
  • Image and font registries for managing image and font resources
  • More complex GUI elements such as wizards and dialogs

Meanwhile, JFace has some dependencies on Eclipse libraries, so that in addition to SWT, some JAR files from the Eclipse project also have to be installed. Eclipse is probably the best-known application that JFace uses.

Available systems and architectures

1 Since SWT 3.5. Apparently only for x86 and x86_64, but no longer available for PowerPC.

Web links


  1. ^ The swt Open Source Project on Open Hub: Languages ​​Page . In: Open Hub . (accessed on October 19, 2018).
  2. Križnar Igor: SWT Vs. Swing Performance Comparison (PDF) March 3, 2006. Archived from the original on July 4, 2008. Info: The archive link was inserted automatically and has not yet been checked. Please check the original and archive link according to the instructions and then remove this notice. Retrieved September 16, 2009: “ Initial expectation before performing this benchmark was to find SWT outperform Swing. This expectation stemmed from greater responsiveness of SWT-based Java applications (eg, Eclipse IDE) compared to Swing-based applications. However, this expectation could not be quantitatively confirmed. " @1@ 2Template: Webachiv / IABot /