Swing GUI Toolkit Group
The Swing group is comprised of developers involved in the design, implementation, and maintanence of Swing GUI Toolkit.
Introduction
Swing is a Graphical User Interface (GUI) API, offering a set of components that can be used to build rich desktop interfaces. This includes basic elements such as windows, buttons, scrollbars, etc., as well as more complex compound objects such as file choosers, color choosers and combo boxes.
Architecture
Swing components are Java Beans, and are built around the Model-View-Controller (MVC) programming paradigm. This paradigm separates an application's business logic from its user interface so that they can be evolved independently.
JComponent is the core Controller
class which coordinates Models and Views to display a final user
component. All Swing components are inherited from
JComponent. Note that components can have different
views represented by different UIs.
The javax.swing.plaf package contains
ComponentUI, which is the core class for the
View and is a template for other components that
inherit from it. ComponentUI is responsible for the
ultimate painting of pixels on the screen.
A Model controls the data in components, from
simple things such as the state of a check box, to the more complex
rows and columns data structures used for a table.
ComboBoxModel and TableModel are example
model classes.
Source Structure
Most of the Swing source code resides under the
src/share/classes directory of the workspace. Under
this directory, source files are organized by their package
hierarchy; for example, the source for
javax.swing.JButton can be found in
src/share/classes/javax/swing/JButton.java.
The javax.swing package contains several
subpackages:
javax.swing.border- specialized borders for Swing componentsjavax.swing.colorchooser- classes and interfaces forJColorChooserjavax.swing.doc-files- ancillary javadoc files for Swingjavax.swing.event- Swing specific eventsjavax.swing.filechooser- classes and interfaces forJFileChooserjavax.swing.plaf- UI base classes and implementations for platform independent Look and Feelsjavax.swing.table- classes and interfaces forJTablejavax.swing.text- classes and interfaces for editable and non-editable text componentsjavax.swing.tree- classes and interfaces forJTreejavax.swing.undo- provides support for undo/redo operations
For historical reasons, some (traditionally) non-public
implementation classes are in a package starting with "sun". The
source for these classes can be found in
src/share/classes/sun/swing.
Platform specific Look and Feels can be found in the
src/share/classes/com/sun/java/swing/plaf directory.
These are non-public implementation classes.
The GKT Look and Feel contains native code implementing gtk rendering with the gtk+-2.0 system library:
src/solaris/native/sun/awt/swing_GTKEngine.csrc/solaris/native/sun/awt/swing_GTKStyle.csrc/solaris/native/sun/awt/gtk2_interface.hsrc/solaris/native/sun/awt/gtk2_interface.c
and also partly in:
- src/solaris/native/sun/awt/awt_UNIXToolkit.c
The solaris directory includes the source for Linux
because of their similarity to Solaris OS code. In fact Swing
sources that lie under solaris directory are the same
for Linux and Solaris.
Building The Source
Swing's make files can be found in the following directories:
make/javax/swing- builds most Swing API classesmake/sun/awtandmake/sun/xawt- builds the native part of the GTK Look and Feel
You can find information on how to build Swing using NetBeans here:
Current Projects
- JSR 295 - Beans Binding: This JSR will provide an API that allows two properties of two beans to stay in sync.
- JSR 296 - Swing Application Framework: This JSR will provide a simple application framework for Swing applications. It will define infrastructure common to most desktop applications. In so doing, Swing applications will be easier to create.
- SwingLabs: SwingLabs is an open source laboratory for Swing. It is an umbrella project for various open source initiatives which seek to make Swing programs faster, easier to write and more visually appealing. Successful code and concepts may be migrated to future versions of the Java(tm) platform.
Community
- Mailing lists



