*
* @throws Exception
*/
public static void setLookAndFeel(String className)
throws Exception {
LookAndFeel laf = null;
if (!className.equals(DEFAULT_LAF)) {
if (className.equals(SYSTEM_LAF)) {
String systemLaf = UIManager.getSystemLookAndFeelClassName();
log.debug("System Look And Feel is " + systemLaf);
laf = (LookAndFeel) Class.forName(systemLaf).newInstance();
} else if (className.equals(CROSS_PLATFORM_LAF)) {
String crossPlatformLaf = UIManager.getCrossPlatformLookAndFeelClassName();
log.debug("Cross Platform Look And Feel is " +
crossPlatformLaf);
laf = (LookAndFeel) Class.forName(crossPlatformLaf).newInstance();
} else {
laf = (LookAndFeel) Class.forName(className).newInstance();
}
}
// Now actually set the look and feel
if (laf != null) {
log.info("Setting look and feel " + laf.getName() + " (" +
laf.getClass().getName() + ")");
UIManager.setLookAndFeel(laf);
UIManager.put("EditorPane.font", UIManager.getFont("TextArea.font"));
}
}