SideStep 4: On Things GUI


Overview

click to expand

There is no SideStep checklist; I'm just going to talk a little bit about the two different GUIs, Swing and SWT. Both are thick-client user interface (UI) strategies; if your application calls for a browser-based approach, or if you are writing distributed applications and your UI is not written in Java, then this SideStep is purely informational.

The two techniques are conceptually similar: You create widgets of one type or another, which you place on the screen, in areas called panes or panels or canvases or frames . Widgets and their containers can be resized, moved, hidden, and made visible. There are a wide variety of text capabilities, including fonts and colors. You can include background colors and images and even draw your own controls line by line or pixel by pixel.

Both Swing and SWT are event driven, with a dispatcher loop that listens for user requests . These can be anything from button clicks to keystrokes to mouse movements. You can attach listeners to widgets to scan for specific events and take the appropriate actions. This is the design philosophy behind all event-driven user interfaces, and it is what makes them so responsive to the user.

However, beyond those basic characteristics, the two approaches quickly diverge. Even the simplest things are different in the two approaches, and the architectural differences are enormous . Hopefully, after reading this SideStep, you'll be in a position to decide which UI technology best suits your needs.

Here are a couple of good URLs for more information:

  • java.sun.com/products/jfc/ ”Sun's Web site on the Java Foundation Classes, including Swing

  • eclipsewiki.swiki.net/2 ”This is pretty much the only place on the Internet for information on the SWT

There are hundreds of other Websites that deal with Swing, as well as dozens of books. Unfortunately, there are no other Web sites and no books on SWT; this is part of the problem of using a new technology.




Eclipse
Eclipse: Step by Step (Step-by-Step series)
ISBN: 1583470441
EAN: 2147483647
Year: 2003
Pages: 90
Authors: Joe Pluta

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net