• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Introduction

Introduction

The Standard Widget Toolkit, typically called SWT, is a graphical user interface (GUI) toolkit for the Java programming language. It was created by the developers of the Eclipse Project to provide access to the native user interface facilities of the operating systems that host the Eclipse universal tools platform. Further information about the Eclipse Project is available at the Web site http://www.eclipse.org. The SWT component home page is http://www.eclipse.org/swt.

Although this book is intended to cover all versions of SWT, it was written during the development of R3.0 of Eclipse. Some of the features that are described here are not available on earlier versions of SWT. For particularly significant additions, this is called out in the text, but for minor differences such as bug fixes, it is not.

In addition to being the standard user interface library for Eclipse development, SWT has proven to be useful for a wide range of stand-alone Java applications on both desktop and handheld systems. This book is aimed at experienced Java programmers who want to use SWT to build modern, GUI-based applications. It is broken into five main parts.

Introduction The introduction, which you are currently reading, contains an overview of SWT and the details of how to get SWT, install it, and make it available to your applications.

Widgets Widgets are the building blocks of a GUI. In SWT, the code that implements the appearance and behavior of the widgets is provided by the underlying operating system; we call this “using native widgets.” This part of the book is the largest, because it describes all of the various kinds of native widgets provided by SWT in detail. It also covers the general aspects of widgets, such as their life cycle, how they interact with the user, how they are arranged into a GUI, and how to access non-widget support resources, such as system dialogs.

Graphics The SWT graphics routines provide access to fonts, colors, images, and primitive graphics operations, such as line and circle drawing. Using these routines, it is possible to configure the appearance of native widgets, to draw application-specific graphics, or to create entirely new custom widgets whose presentation is drawn by your application.

Applications This section provides a pair of example applications that are intended to show best practice uses of SWT in real-world situations. They represent both good starting points for new application development and valuable sources of information on how it all fits together. The intent is to take the book beyond being just a reference for the SWT application programming interface (API) by showing you what a good SWT program should look like.

We believe that the programmer's equivalent of the old adage, “A picture is worth a thousand words” is “A program is worth a thousand words,” so throughout the book, whenever there is an important topic or a new feature to be described, you will always see a snippet of code that shows exactly how to use that feature alongside the description. To the greatest extent possible, this code represents either a complete program that you can run and test out or a fragment of such a program. The source code for all examples is available for download at http://www.awprofessional.com/title/0321256638.

The rest of the introduction consists of an overview of the rationale and history behind SWT, followed by a description of how to get it and use it in your applications.

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint