Archived
April 1998
By Mark Andrews
The
Swing track was jammed to capacity at JavaOne, the developer
extravaganza held on March 24 through March 27 in San Francisco's
Moscone Convention Center.
JavaOne 1998 -- the biggest single-location developer's
conference in the computer industry -- featured a four-day lineup
of keynote addresses and more than 100 introductory and technical
sessions.
Reporters from The Swing Connection attended all the Swing-related
events at JavaOne, and coverage of some of the sessions presented
by the Swing team appears in this issue. Articles based on
other JavaOne presentations will be published in upcoming
issues.
JavaOne crowd learns to Swing
This
year's JavaOne conference focused on a host of new features
and capabilities that are now being incorporated into the
Java programming language. One major topic was the upcoming
release of Version 1.2 of the Java Development Kit. In that JDK
release, Swing will become part of the JDK core.
(Meanwhile, Swing -- known more formerly as JFC 1.1 -- is
available to developers as a separate download. To learn more about
Swing, the JDK, and JFC, see the "Introducing
Swing" article in The Swing Connection.)
To familiarize developers attending JavaOne with the features
and capabilities of Swing, members of the Swing team hosted six
developers' sessions:
- JFC Technology: An Overview and Roadmap to the Future.
- JFC Programming: How to Build an Application.
- JFC Programming: Advanced Topics.
- Designing a Cross-Platform Look and Feel.
- Project Swing Component Architecture.
- International Text.
The Swing Connection covered all these sessions, and a brief
description of each one appears under the subheadings that follow.
For complete coverage of all the keynote addresses and sessions
presented at JavaOne, visit the main JavaOne Web site at java.sun.com/javaone.
'Roadmap' session introduces
Swing
The
creators of Swing kicked off a four-day series of introductory
and technical sessions on Tuesday, with an overview of JFC
technology and the Swing component set. After presenting a
brief history of Swing, the session hosts described the basic architecture
of Swing components and introduced the topic of Swing's pluggable
look-and-feel (PL&F) design -- themes that were scheduled
to be covered in more detail in subsequent Swing-related sessions.
Team member Rick Levenson kicked off the introductory session
by outlining the relationships that exist between JFC, Swing, and
other JDK technologies, including the Abstract Windowing Toolkit
(AWT) and the JavaBeansTM
API. Before he delivered his talk, he was interviewed by The
Swing Connection.
What's ahead for Swing
Although the Swing 1.0 component set is officially designated
JFC 1.1, Levenson explained to TSC, Swing will become part of the
JDK core when JDK 1.2 is released. (By the time that happens,
JFC will not only include Swing, but will also include Java
2D, the Drag and Drop API, and other essential JFC services,
Levenson noted.)
When Swing is rolled into JDK 1.2, Levenson continued, Swing
will continue to be available as a separate download for people
who want to continue using JDK 1.1. That means that Swing
will be distributed in two different ways -- both as a standalone
download designed to be used with JDK 1.1, and as an integral
part of the JDK 1.2 core.
But Levenson emphasized that from a source-code point of
view, there won't be any difference between the Swing component
set that's designed to be used with JDK 1.1 and the Swing
set that will be bundled with JDK 1.2.
Two distributions, but just one Swing
"We don't have two bodies of source, one for 1.2 and
one for 1.1," Levenson explained. That's important, he said,
because it means that the "Write Once, Run Anywhere"TM
Java programming philosophy applies not only to different
operating systems and to different platforms, but even to
different distributions of the same set of Swing APIs.
Consequently, he said, developers who use Swing components
in their applications can be confident that at the source-code level,
the Swing components they are using are exactly the same, whether
they are provided as part of the JDK 1.2 core or are provided
in a form that's designed to be used with JDK 1.1.
Other speakers at the introductory session were Swing team
members Tom Ball, Hans Muller, and Amy Fowler.
Swing app-building demystified
Members of the Swing
team ventured into deeper technological waters Tuesday afternoon
when they presented a session showing developers how to write
programs using Swing components. The session was titled "JFC
Programming: How to Build an Application."
Team members Georges Saab, Philip Milne, and Richard Schiavi
showed developers how Swing implements menus, toolbars, and tables,
and how developers can use application-building packages such
as Borland's JBuilder to create Swing programs.
Saab, the author of Swing's menu and toolbar APIs, showed
how Swing uses an "Action" interface to synchronize and
coordinate the behavior of menu items and toolbar buttons
that are designed to carry out the same operations. The Swing
Connection transcribed Saab's presentation and will be publishing
excerpts from it -- complete with illustrations and source-code
examples -- in an upcoming issue.
Milne used a colorful collection of slide graphics to show
how Swing implements tables using the JTable class. JTable objects
are so versatile, he said, that they can be used to display
and manipulate just about any kind of data that can be reduced
to matrices of rows and columns. An article based on Milne's
presentation, and including pictures from his slides, will
also be appearing soon in The Swing Connection.
Schiavi treated the JavaOne crowd to a sneak preview of how
the next generation of Borland's JBuilder -- now in beta testing
-- can be used to write Swing applets and applications. As
you have probably guessed by now, The Swing Connection witnessed
Schiavi's demonstration and will be presenting a report on
it in an upcoming issue.
Swing text and the drag-and-drop
API
Text expert Tim Prinzing,
the author of Swing's text-component API, explained how Swing
implements text-editing and -formatting features in a Thursday
presentation at JavaOne.
In the same session, drag-and-drop API author Larry Cable
presented a slide talk showing developers how to incorporate drag-and-drop
operations into their Java applets and applications.
Their joint session was titled "JFC Programming: Advanced
Topics."
Swing expert talks text
Prinzing conceded that Swing's text API is large and complex,
but he contended that its multitude of parts actually makes life
easier for most Swing developers. Although Swing's text components
are designed to be easy to use, said Prinzing, "easy"
does not necessarily mean "simple" when you're designing
a text API.
The Swing text package "is somewhat complex as a result
of its goals," he acknowledged. But "even though the underlying
package is complex," he said, a set of simple wrappers has
been layered over its complex capabilities "to make the
most common tasks simple."
Prinzing described the complex (though easy-to-use) Swing
text package using a series of slides that showed exactly the various
pieces of the text package work, and how they all fit together.
All the points that Prinzing presented in his talk -- and
the slides he used to illustrate them -- will be published in a
major article in the April issue of The Swing Connection.
The JFC drag-and-drop API
The second speaker at the "Advanced Topics" session
was Larry Cable, author of the JFC drag-and-drop API. He showed
developers how drag-and-drop operations work and how they
can be implemented in JFC programs.
The JFC drag-and-drop API is not part of the Swing set, Cable
explained, because it is a "heavyweight" component --
that is, it is designed to make use of operating-system code ("peer"
code) that's provided by the platform on which it is running. In
contrast, all Swing components are considered "lightweight"
because they don't rely on user-interface code that's native
to the operating system they're running on. (For more details,
see the "Introducing Swing" article in this
issue.)
Nonetheless, the JFC drag-and-drop API -- like Swing -- is
part of JFC 1.1 and will be incorporated into the JDK core when
JDK 1.2 is released later this year.
The JFC drag-and-drop API will be the topic of a major article
appearing soon in The Swing Connection.
Designing a Cross-Platform
Look and Feel
Senior Interface
Engineer Chris Ryan, the designer of the cross-platform Java
Look and Feel provided with Swing, provided a host of tips,
tricks, and design concepts to Swing developers in a Thursday
session titled "Designing a Cross-Platform Look and Feel."
Other speakers at the session were Harry Vertelney, Manager
of the JavaSoft Human Interface Group, and Software Engineer Steve
Wilson.
At the user interface level, living up to the promise of
"Write Once, Run Anywhere" requires a cross-platform user
interface toolkit, the speakers at this session explained.
To show how the Swing toolkit lives up to this promise, the
speakers presented a suite of presentations showing how to
design and implement a new look and feel using JFC technology.
Before JavaOne began, Ryan wrote an article for The Swing
Connection explaining how he and other members of his design team
created the Java Look and Feel. That article, titled "The
Project Metal Report," is in The Swing Connection
archive.
A major article based on Steve Wilson's presentations at
JavaOne will be published in an upcoming issue. Stay tuned.
Component architecture and
JFC accessibility
Swing
engineers Hans Muller, Steve Wilson and Peter Korn explained
and demonstrated the architecture of the Swing component set
at a Thursday session titled "Project Swing Component
Architecture."
Muller recalled that when the Swing team first started the
job of creating a GUI toolkit, the team's primary goal was to develop
a single API that could implement a set of GUI components with multiple
appearances and multiple behaviors -- that is, with multiple
look-and-feels.
Although the creators of Swing wanted to create a generic
API, Muller continued, they didn't want to mandate the appearances
and the behaviors -- that is, the looks and feels --
of the components that the API would define. And when you
look at the architecture of Swing today, Muller said, you
can see that much of its final design has stemmed from that
one goal.
Muller illustrated his point by outlining the design concepts
that have now been incorporated into Swing's pluggable look-and-feel
architecture. Then he explained how programmers can make use
of Swing's PL&F capabilities in their own applets and
applications.
Another speaker, Swing team member Steve Wilson, presented
a series of code samples showing how developers can modify the PL&F
designs provided with Swing to meet their individual needs and desires.
Wilson also showed JavaOne attendees how they can take the next
step in L&F design and build their own customized pluggable
look-and-feel designs.
The session's third speaker, Peter Korn, demonstrated JFC's
accessibility API, which provides easy-to-implement assistive technologies
to developers who want to build applications using JFC and Swing.
The JFC accessibility API, like the drag-and-drop API, is
part of JFC 1.1 but is not part of Swing. Like Swing, however, it
will remain part of JFC and will become part of the JDK core
when JDK 1.2 is released later this year.
Major articles covering the topics that Muller, Miller, and
Korn presented will appear in soon-to-be-published issues of The
Swing Connection.
|