The
Java Look and Feel
Swing's Cross-Platform L&F
Design
By Michael Albers and Chris Ryan
Pluggable
look-and-feel -- one of the most noteworthy features of the
Swing tool set -- lets developers create components that can
automatically take on the appearance and behavior of whatever operating
system they happen to be running under.
But suppose you wanted to develop a Swing application that
always have exactly the same look and feel, no matter
what operating system the user happened to be using?
That's easy. You'd create your application using JavaTM
look and feel: the cross-platform L&F implementation
that ships with Swing.
The Java look and feel -- formerly called "Metal"
because that was its code name while it was beeing developed
-- is designed especially for developers who want a sleek,
elegant cross-platform L&F that looks and behaves the
same across all operating systems. It became Swing's official cross-platform
L&F after receiving enthusiastic feedback from developers.
A brief history of the Java Look
and Feel
The Java Look and
Feel -- previously known as Metal because that was its project
code name -- is a cross-platform design that that is shipped with
Swing.
Swing also comes with a Windows look-and-feel implementation
and a Motif look-and-feel design.
A fourth new look and feel design -- a Macintosh implementation
-- made its debut with the introduction of Swing 1.1 Beta. The Mac
L&F implementation was initially provided in a preview
release to let developers try it and give us feedback.
When the new Mac L&F is finalized, it will officially
become part of Swing. Stay tuned.
Java L&F in the Forefront
The
cross-platform Java Look and Feel heads the JFC 1.1. lineup of new
look-and-feel designs. The article titled "The
Project Metal Report" explains how the Java L&F
was designed.
To learn still more about the Java L&F -- and to get a peek
at a collection of screen shots illustrating the new Metal
look -- see "The high-level
JLF Specification."
Swing's L&Fs illustrated
The following screen
shots show the four prepackaged L&F designs that are currently
available to Swing developers.
|
Java
Look and Feel
|
|
|
|
|
MacOS
Look and Feel
|
|
|
|
Motif
Look and Feel
|
|
|
|
Windows
Look and Feel
|
|
|
|
L&Fs that Swing provides
The four PL&F
designs shown in the preceding picture are:
- The Java Look and Feel: Swing's default pluggable L&F
implementation.
- The Motif look and feel, which was shipped with early-access
releases and continues to be provided Swing. The Motif L&F
is supplied as an example of an L&F that harmonizes
and works well with the Motif desktop environment.
- The Win32 (Windows-style) look and feel that is designed
to be used with Windows NT and Windows 95 implementations
of Swing. For more details about how the Win32 L&F is
intended to be used, see the archived Commentary article titled
"A
Message to Our Swing Developers."
- The Macintosh look and feel.
No
matter how many new pluggable L&Fs wind up being shipped
with Swing, you can always create your own custom designs.
Articles showing how to create your own PL&F implementations
will be published in upcoming issues of The Swing Connection.
Thanks
for your feedback, keep it coming
The Swing team extends
many thanks to those of you who have taken the time to give
us constructive comments regarding Swing's pluggable L&Fs.
We'll do our best to keep you informed of the feedback
we're receiving, our directions, and our progress.
|