[an error occurred while processing this directive]

Page One
Page Two
The Databank
What Is Swing?
Special Report
IDE Roundup
Swing and the Web
Swing Text
Tech Topics
Friends
Tips and Tricks
The PLAF Papers
Call 911
The Archive
JFC Home
Download Swing
Swing API Docs
Download JDK
JDK Docs
Java Tutorial
 
The Swing Connection The PLAF Papers

Swing's MacOS L&F
It's Slimmer, Faster, and More Powerful


There's something for everyone in Swing 1.1 (now part of the JDK 1.2 core). For example, if you're an Apple Macintosh developer, you may be glad to hear there's a fully operational Macintosh look-and-feel implementation for Swing.

Java (TM) cup with Apple (TM) logoSwing's MacOS L&F was originally introduced in an early-access version available for download from the Java Developer Connection. Now, when you download Swing 1.1 using a Macintosh, you automatically get the new Swing MacOS package.

Swing's MacOS look and feel is designed to work only on Macintosh computers, in the same way that Swing's Windows L&F is intended to work only on computers running Windows. Because the MacOS Look and Feel runs only on MacOS systems, its archive is stored in a Macintosh format -- a stuffed-binhexed format that Stuffit Expander can open. The archive contains a mac.jar file and complete source code. For more details on this topic, see the item headed "If it looks like a Mac and feels like a Mac" in the 911 column.

Mac windowThe Swing team encourages Mac developers to experiment with the new MacOS L&F and then to comment on it by sending e-mail to

 swing-feedback@java.sun.com.

The Mac L&F introduced with Swing 1.1 Beta is a complete rewrite of an earlier Mac L&F that was provided with Versions 1.0 through 1.0.2 of Swing.

"The previous version suffered from some performance issues, and when the Swing plaf layer was overhauled, it was decided it would be easier to start from scratch," explained Swing team member Steve Wilson, who helped develop the new Mac L&F. Early indications indicate that the new Mac look and feel is smaller, faster, and more robust than its predecessor, he added.

The following screen shot shows what the new Mac L&F looks like when it is displayed on a Macintosh computer:

Mac L&F window 


Downloading and using the Mac L&F

You can obtain the new Swing look and feel by downloading it from the Java Software Developer Connection Web site, which is at

http://java.sun.com/jdc

To use the new Mac L&F, you'll need Version 1.1 Beta of  Swing, which you can download from the same site. Also, you must add mac.jar to your classpath. Then add the following lines of code to your Swing-based application:


try {
   UIManager.setLookAndFeel
       ("com.sun.java.swing.plaf.mac.MacLookAndFeel");
} catch ( Exception e ) {
    System.out.println ("Couldn't load Mac L&F" + e);
}


The Mac L&F and Apple's MRJ

Swing's new Mac look and feel has been tested with Macintosh OS Runtime for Java (MRJ), and with an early access release of MRJ 2.1. MRJ, implemented as a set of shared libraries and other system software files, lets users run Java applets and applications on PowerPC and 68040 computers running Mac OS 8.0 or later.

MRJ supports all the new Java features introduced in version 1.1 of Sun's core Java specification, including JavaBeans, internationalization, security and signed applets, the JAR file format, the Java math package, remote method invocation (RMI), object serialization, reflection, Java Database Connectivity (JDBC), inner classes, and the Java Native Interface (JNI).

You can download MRJ and the MRJ SDK from

http://www.apple.com/macos/java


Wanted: Your feedback

When you've tried out Swing's new Mac L&F, be sure to send your comments and suggestions to

swing-feedback@java.sun.com

[an error occurred while processing this directive]