public static void main(String[] args) throws Exception {
String themepack = "themepack.zip";
if (themepack.endsWith(".xml")) {
SkinLookAndFeel.setSkin(SkinLookAndFeel.loadThemePackDefinition(SkinUtils.toURL(new File(themepack))));
SkinLookAndFeel.enable();
} else if (themepack.startsWith("class:")) {
String classname = themepack.substring("class:".length());
SkinLookAndFeel.setSkin((Skin)Class.forName(classname).newInstance());
SkinLookAndFeel.enable();
} else if (themepack.startsWith("theme:")) {
String classname = themepack.substring("theme:".length());
MetalTheme theme = (MetalTheme)Class.forName(classname).newInstance();
MetalLookAndFeel metal = new MetalLookAndFeel();
metal.setCurrentTheme(theme);
UIManager.setLookAndFeel(metal);
} else {
SkinLookAndFeel.setSkin(SkinLookAndFeel.loadThemePack(themepack));
SkinLookAndFeel.enable();
}
[color=“red”][b] if (OS.isOneDotFour()) {
java.lang.reflect.Method method = JFrame.class.
getMethod(“setDefaultLookAndFeelDecorated”,
new Class[]{boolean.class});
method.invoke(null, new Object[]{Boolean.TRUE});
method = JDialog.class.
getMethod("setDefaultLookAndFeelDecorated",
new Class[]{boolean.class});
method.invoke(null, new Object[]{Boolean.TRUE});
}[/b][/color]
JFrame f = new JFrame("Skin Look And Feel " + SkinLookAndFeel.version());
f.pack();
WindowUtils.centerOnScreen(f);
f.setVisible(true);
}
}
nao entendi o pq disso…pois se tenho um LookAndFeel, o normal é eu passar o objeto referente ao LookAndFeel e seta-lo não ?