|
Nimbus Look and Feel
|
Contents
Nimbus is a new cross platform look and feel that is drawn with 2D vector graphics and can be rendered at any resolution.
There are two ways to activate the Nimbus Look and Feel.
Add the following snippet to your source code:
try {
for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (UnsupportedLookAndFeelException e) {
// handle exception
} catch (ClassNotFoundException e) {
// handle exception
} catch (InstantiationException e) {
// handle exception
} catch (IllegalAccessException e) {
// handle exception
}
To activate Nimbus Look and Feel for an application, specify the following when running the Java application
-Dswing.defaultlaf=com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel
Copyright
©2008 Sun Microsystems, Inc. All Rights Reserved.
Feedback |
|