Search on this blog

Wednesday, May 10, 2006

JFC overview

Sun Microsystems is leveraging the technology of Netscape Communications, IBM, and Lighthouse Design (now owned by Sun) to create a set of Graphical User Interface (GUI) classes that integrate with JDK 1.1.5+, are standard with the Java ® 2 platform and provide a more polished look and feel than the standard AWT component set. The collection of APIs coming out of this effort, called the Java Foundation Classes (JFC), allows developers to build full-featured enterprise-ready applications.

JFC is composed of five APIs: AWT, Java 2D, Accessibility, Drag and Drop, and Swing. The AWT components refer to the AWT as it exists in JDK versions 1.1.2 and later. Java 2D is a graphics API based on technology licensed from IBM/Taligent. It is currently available with the Java® 2 Platform (and not usable with JDK 1.1). The Accessibility API provides assistive technologies, like screen magnifiers, for use with the various pieces of JFC. Drag and Drop support is part of the next JavaBean generation, "Glasgow," and is also available with the Java® 2 platform.

Swing includes a component set that is targeted at forms-based applications. Loosely based on Netscape's acclaimed Internet Foundation Classes (IFC), the Swing components have had the most immediate impact on Java development. They provide a set of well-groomed widgets and a framework to specify how GUIs are visually presented, independent of platform. At the time this was written, the Swing release is at 1.1 (FCS). IFC, AWT, and Swing: Sorting it all out

Though the Swing widgets were based heavily on IFC, the two APIs bear little resemblance to one another from the perspective of a developer. The look and feel of some Swing widgets and their rendering is primarily what descended from IFC, although you may notice some other commonalties.

The AWT 1.1 widgets and event model are still present for the Swing widgets. However, the 1.0 event model does not work with Swing widgets. The Swing widgets simply extend AWT by adding a new set of components, the JComponents, and a group of related support classes. As with AWT, Swing components are all JavaBeans and participate in the JavaBeans event model.

A subset of Swing widgets is analogous to the basic AWT widgets. In some cases, the Swing versions are simply lightweight components, rather than peer-based components. The lightweight component architecture was introduced in AWT 1.1. It allows components to exist without native operating system widgets. Instead, they participate in the Model/View/Controller (MVC) architecture, which will be described in Part II of this course. Swing also contains some new widgets such as trees, tabbed panes, and splitter panes that will greatly improve the look and functionality of GUIs. Swing Package Overview

Swing can expand and simplify your development of cross-platform applications. The Swing collection consists of seventeen packages, each of which has its own distinct purpose. As you'll learn in this short course, these packages make it relatively easy for you to put together a variety of applications that have a high degree of sophistication and user friendliness.

javax.swing
The high level swing package primarily consists of components, adapters, default component models, and interfaces for all the delegates and models.
javax.swing.border
The border package declares the Border interface and classes, which define specific border rendering styles.
javax.swing.colorchooser
The colorchooser package contains support classes for the color chooser component.
javax.swing.event
The event package is for the Swing-specific event types and listeners. In addition to the java.awt.event types, Swing components can generate their own event types.
javax.swing.filechooser
The filechooser package contains support classes for the file chooser component.
javax.swing.plaf.*
The pluggable look-and-feel (PLAF) packages contain the User Interface (UI) classes (delegates) which implement the different look-and-feel aspects for Swing components. There are also PLAF packages under the javax.swing.plaf hierarchy.
javax.swing.table
The table package contains the support interfaces and classes the Swing table component.
javax.swing.text
The text package contains the support classes for the Swing document framework.
javax.swing.text.html.*
The text.html package contains the support classes for an HTML version 3.2 renderer and parser.
javax.swing.text.rtf
The text.rtf package contains the support classes for a basic Rich Text Format (RTF) renderer.
javax.swing.tree
The tree package contains the interfaces and classes which support the Swing tree component.
javax.swing.undo
The undo package provides the support classes for implementing undo/redo capabilities in a GUI.
javax.accessibility
The JFC Accessibility package is included with the Swing classes. However, its usage is not discussed here.
Widgets, Widgets, Widgets

This section describes how to use the various Swing widgets. The Swing component hierarchy is shown in two parts for comparison with AWT. Part 1 of the component hierarchy is similar to that of AWT. However, there are over twice as many components in Swing as in AWT. Part 2 shows the expanded Swing component set. This group of components appeals most to developers, as it provides a much richer set of widgets to use.



Component Hierarchy: Part 1--AWT Similar

Component Hierarchy: Part 2--New And Expanded Components

0 comments:

Post a Comment

Featured Video

Featured Article

Poems