Set the LookAndFeelTag(s): Swing
By default, Swing will use the Metal LookAndFeel. To set the LookAndFeel to the current OS under which the JVM is running, use this snippet :
try {
UIManager.setLookAndFeel(
UIManager.getSystemLookAndFeelClassName());
}
catch (Exception e) {
e.printStackTrace();
}Even with the new naming mecanism in JDK1.2, some LookAndFeel packages are keeping the oldname.
| Windows | com.sun.java.swing.plaf.windows (no change) |
| Motif | com.sun.java.swing.plaf.motif (no change) |
| Mac | com.sun.java.swing.plaf.mac (no change) |
| Metal | javax.swing.plaf.metal (new) |
| Basic | javax.swing.plaf.basic (new) |
| Multi | javax.swing.plaf.multi (new) |
These packages are located in the rt.jar file.
mail_outline
Send comment, question or suggestion to howto@rgagnon.com
Send comment, question or suggestion to howto@rgagnon.com