Home > Store > Programming > Java

larger cover

Add To My Wish List

SWT: The Standard Widget Toolkit, Volume 1

Register your product to gain access to bonus material or receive a coupon.

  • Description
  • Downloads
  • Reviews
  • Sample Content

Product Author Bios

The principal architect of the Standard Widget Toolkit (SWT), Steve Northover joined IBM OTI Labs in 1990. He is an expert on performance, programming for operating systems, and native user interface toolkits. He is the lead of the Eclipse SWT team and is one of the few people who understands the implementation of the toolkit on every platform.

Mike Wilson has been a part of IBM OTI Labs since its inception in 1987 as Object Technology International, Inc. Over the years he has played a major part in many of the company's most significant successes, including contributing to the design, implementation, and maintenance of SWT. Currently, he is active in many aspects of the Eclipse Platform, including the Core and Team teams.



The Standard Widget Toolkit (SWT) is a new class library for creating graphical user interfaces (GUIs) in Java. Created as part of the Eclipse project, SWT allows developers to build efficient, portable applications that directly access the user-interface facilities of the operating systems it is implemented on. This revolutionary technology makes it possible to create Java-based applications that are indistinguishable from a platform's native applications.

SWT: The Standard Widget Toolkit, Volume 1, will show you how to:

  • Get SWT, install it, and invoke it from your programs.
  • Understand widgets--the building blocks of GUI--and how they interact with users and compose a GUI.
  • Use graphics routines to configure the appearance of native widgets and draw application-specific graphics.
  • Apply best practices from real-world uses of SWT.
  • Appreciate what makes a quality SWT program.

In this book--the first definitive guide to SWT--two of the technology's lead designers and implementers show you how to break the task of building a GUI-based application into components. They then show how these components are modeled in SWT and provide a series of graded examples. The result is a guided tour of the essential aspects of this exciting toolkit, ranging from mouse and keyboard handling to user-interface controls for native operating systems.

If you want to build modern GUI-based application, SWT: The Standard Widget Toolkit, Volume 1, will prove an invaluable guide and reference.



Source Code

Download the Source Code related to this title.

Customer Reviews

14 of 15 people found the following review helpful
5.0 out of 5 stars Best book for the details -- and you'll need them!, January 1, 2005
By 
Alexander Garrett (Madison, WI USA) - See all my reviews
(REAL NAME)   
This review is from: SWT: The Standard Widget Toolkit, Volume 1 (Paperback)
First, a caveat -- this book only covers SWT, the Standard Widget Toolkit, and not JFace. Presumably, JFace will be covered in a forthcoming book. That said, using JFace well requires a good knowledge of SWT, so it would be a mistake to avoid this book just because it doesn't include JFace topics.

This book was written by Steve Northover, one of the architects of SWT, and Northover's profound knowledge of SWT is evident on every page. He communicates clearly and efficiently the details that you need to know in order to be a good SWT programmer. Understanding event-driven programming is skill of a different order than "regular" programming. Operations aren't as neatly sequenced in the former and, as a result, both programming and debugging can be more difficult, especially for one not used to the programming style. Northover spends a lot of time covering the internals of SWT and making sure that things like the Display and Controls are clearly explained, rather than simply... Read more
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


9 of 10 people found the following review helpful
5.0 out of 5 stars The Definitive Guide to SWT, July 30, 2004
This review is from: SWT: The Standard Widget Toolkit, Volume 1 (Paperback)
This is one of two books that I purchased at Java One a few weeks ago (I also have the Gamma/Beck book which is also part of the same series). It is written by the chief architects of SWT itself and provides some wonderful insight into the internals of SWT. The examples are well chosen and easy to follow and lots of tips are provided for dealing various arcane SWT issues.

The book intro includes a section on the history of SWT which I found to be fascinating given all of the Swing vs. SWT discussions in the press over the last couple of years. Every widget and layout manager is discussed in considerable detail and there is a nice discussion on creating custom widgets and using custom graphics.

Ultimately, this is a great reference that you will want to keep close by, if you are planning to build any SWT apps, Eclipse plugins or Eclipse RCP apps. I very much look forward to reading Volume 2!
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


4 of 4 people found the following review helpful
5.0 out of 5 stars SWT Fundamentals, May 14, 2005
By 
A. Jain (San Mateo, CA United States) - See all my reviews
(REAL NAME)   
This review is from: SWT: The Standard Widget Toolkit, Volume 1 (Paperback)
If you want to learn the SWT fundamentals, read this book. Remember that JFace, Eclipse IDE, Eclipse Rich Client Platform applications all use SWT at the bottom. While the book does not cover some advanced topics like custom widgets and layouts, it will build a solid foundation for understanding these advanced topics.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


Share your thoughts with other customers:
 See all 9 customer reviews...

Online Sample Chapter

Java Widget Fundamentals

Table of Contents



Foreword by Erich Gamma.


Preface.


Introduction.

I. WIDGETS.

If You Don't Read Anything Else….

1. Widget Fundamentals.

What Is a Widget?

Widget Hierarchy.

Events and Listeners.

Application Data.

Querying the Display.

Summary.

2. The Keyboard.

When a Key Is Typed, Where Does It Go?

Keyboard Events and the Focus Control.

Traversal.

Accelerators.

Window System Keys.

Summary.

3. The Mouse.

Mouse Events.

Selection.

Summary.

4. Control Fundamentals.

Bounds.

Client Area.

Moving and Resizing.

Visibility.

Z-Order.

Enabling and Disabling.

Preferred Size.

Painting.

Repainting and Resizing.

Filling the Background.

Summary.

5. Display.

Naming Your Application.

Display Life Cycle.

Events and Listeners.

Event Filters.

Runnable "Execs".

The Event Loop.

Multithreaded Programming.

Timers.

Putting It All Together: Multithreading, Timers, Events, and the Event Loop.

Monitors, Bounds, and Client Area.

The Active Shell, All Shells, and Focus Control.

Cursor Control and Location.

Display Depth and DPI.

Updating the Display.

Application Data.

Coordinate Mapping and Mirroring.

Miscellaneous.

Summary.

6. Native Widgets.

Native Widgets Summary.

7. Basic Controls.

Class Label.

Class Button.

Class Text.

Class List.

Class Combo.

Summary.

8. Tool Bars and Menus.

Classes ToolBar and ToolItem.

Classes Menu and MenuItem.

Summary.

9. Advanced Controls.

Classes Tree and TreeItem.

Classes Table, TableItem, and TableColumn.

Classes TabFolder and TabItem.

Summary.

10. Range-Based Controls.

Class ProgressBar.

Class Scale.

Classes ScrollBar and Slider.

Summary.

11. Controls, Composites, Groups, and Shells.

Class Control.

Class Composite.

Class Group.

Class Shell.

Summary.

12. Canvas and Caret.

Class Canvas.

Class Caret.

Summary.

13. Draggable Controls.

Classes CoolBar and CoolItem.

Class Sash.

Class Tracker.

Summary.

14. Dialogs.

Creation.

Opening a Dialog.

Setting the Title.

MessageBox.

FileDialog.

DirectoryDialog.

ColorDialog.

FontDialog.

Summary.

15. Layout.

When Are Layouts Invoked?

Class Layout.

Layout Data.

Class FillLayout.

Classes RowLayout and RowData.

Class GridLayout.

Defining the Grid.

Class FormLayout.

Assigning Width and Height Hints.

Which Layout Should I Use?

Forcing a Layout.

Forcing Controls to Wrap.

Summary.

II. GRAPHICS.

16. Graphics Fundamentals.

Points and Rectangles.

Class Point.

Class Rectangle.

The Graphics Context.

Graphics and Threads.

Line and Figure Drawing.

Clipping and Regions.

17. Colors.

Class RGB.

Class Color.

System Colors.

18. Fonts.

Class FontData.

Class Font.

Drawing Text.

Class FontMetrics.

19. Images.

Class ImageData.

Class Image.

Animation.

Loading Images.

20. Cursors.

System Cursors.

Custom Cursors.

III. APPLICATIONS.

21. Minesweeper.

How to Play.

Implementation Notes.

22. FileExplorer.

Features.

Implementation Notes.

IV. NEXT TIME.

Index.

Downloadable Sample Chapter

Download the Sample Chapter related to this title.

Foreword

Download the Foreword file related to this title.

Index

Download the Index file related to this title.

 
Purchase Reward: One Month Free Subscription
By completing any purchase on InformIT, you become eligible for an unlimited access one-month subscription to Safari Books Online.

Get access to thousands of books and training videos about technology, professional development and digital media from more than 40 leading publishers, including Addison-Wesley, Prentice Hall, Cisco Press, IBM Press, O'Reilly Media, Wrox, Apress, and many more. If you continue your subscription after your 30-day trial, you can receive 30% off a monthly subscription to the Safari Library for up to 12 months. That's a total savings of $199.