Navigation Bar

Column Head: About Swing

Column Heading: Component APIs

App Service APIs

Heading: Miscellaneous

Heading: Pluggable L&F APIs

Download Swing Swing JavaDoc APIs JDK 1.1.4 Documentation
JDK 1.1.4 Download
JFC Web Site README


Head: Feedback


Page Heading: Swing Overview - 1

100% Pure Java LogoSwing (not an acronym) is the name of a new set of GUI components being developed by JavaSoft. Components in the Swing set are implemented in 100% pure Java code, and are based on the Lightweight UI Framework introduced in JDK 1.1. Swing components include many new features and capabilities that make them more flexible and more powerful than pre-Swing AWT controls. The new features of Swing controls include a modified MVC (model-view-controller) architecture, a new set of new pluggable look-and-feel capabilities, and much more.

When the Swing component set is complete, it will not only include a collection of 100% Java versions of existing AWT components (such as Button, Scrollbar, List, and so on), but will also also include a rich set of higher-level components such as TreeView, ListView, TabbedPane, and others.

All the new features and capabilities of Swing components are described in more detail under separate headings in the rest of this overview and in the other sections of this documentation set.


Head: Goals for Swing

The Swing team at JavaSoft prepared this release with a specific set of goals in mind. They are:

  • To unify the Java GUI toolkit APIs: With Swing, we are delivering what the market is demanding: a comprehensive set of highly configurable user-interface components that are easy to use and to extend. Starting with this initial release, we will incrementally deliver releases of Swing software that are compatible with JDK1.1, and we will bundle the final release of Swing with JDK1.2.
  • To move toward a comprehensive set of Java components: Swing is a comprehensive set of user-interface components whose look and feel can be defined at runtime. The Swing component set -- designed in close cooperation with Netscape engineers and incorporating the best ideas from both JFC and IFC -- is more than a match for the best competitors on the market today.
  • To be 100% Java -- and lightweight: Because Swing components are based on the JDK 1.1 Lightweight UI Framework, they all support transparency, and they all fit into the existing AWT models. Like all AWT components, they are all fully JavaBeans-compliant. Finally, because they are implemented as lightweight components in common Java code, Swing components do not have the overhead of being associated with native "peer" widgets and are guaranteed to work consistently across all Java platforms.


Head: What Swing Hath Wrought

By pursuing the goals listed under the preceding heading, the designers of the Swing component set were able to achieve the following results:

  • They created a new set of components that are written entirely in Java and support a "Pluggable Look and Feel" (L&F) architecture. As you will see in the specification titled "The UIFactory Class," the appearance and behavior of Swing components is defined by a delegate -- that is, an object that can be specified at runtime. In MVC terms, this delegate is what's known as a view/controller. Its job is to define how the component renders itself and how it responds to input events. (For more details, see the second document in this set, "Swing Architecture".)
  • It's easy to convert code that was written using the existing Abstract Windowing Toolkit (AWT) into Swing-compatible code. (Because some Swing classes have different names than their AWT predecessors, you'll probably have to change the names of some of the classes and objects that are used in your legacy code, but that's all you'll have to do to it to make it Swing-compatible. Your code must also use the SDK 1.1 event delegate model.)
  • You can use the Swing components without any knowledge of their MVC foundation or their pluggable-look-and-feel capabilities -- they're just components!
  • With Swing, it's easy to create a new L&F that's a refinement of an existing one. Creating an entirely new L&F from scratch is also straightforward. With the advent of Swing, we expect that application houses and corporations will start creating their own L&F modules to give their products a distinct identity. (For more details about Swing's pluggable L&F architecture, see the specification titled "The UIFactory Class."
  • Swing components currently provide two complete L&F implementations, and other implementations created. One of the current Swing implementations has a Windows L&F; the other is unique to JavaSoft.


Head: Delivering Swing

Because the Swing set of components is being developed in 100% pure Java to run on top of a 1.1.X-based JDK, we are decoupling the initial development and early-release process from the general JDK (similar to the way in which early versions of both JDBC and JavaBeans were released). This will allow us to get specs and early-access releases out to the developer community as soon as possible so that we have plenty of time to listen to and incorporate your feedback before the APIs become final in an upcoming JDK release.


Head: Continued --

This Overview is divided into two parts. The page you are now reading introduces Swing, lists and explains the goals of Swing's designers, describes the major features of the Swing set, and takes a look at delivery strategy.

The second part of this Overview Small right arrow describes and illustrates the pluggable look-and-feel capabilities of Swing components, and examines the model-view-container (MVC) architecture on which Swing's pluggable L&F components are based. Part 2 also shows how you can start using the features and capabilities of Swing components in your own applets and applications.


Version 0.5. Last modified 10/1/97.
Copyright © 1995-97 Sun Microsystems, Inc. All Rights Reserved.

Sun Logo