for (int i=0; i<infos.length; ++i) {
if (classname.equals(infos[i].getClassName())) skip = true;
}
// do not install already installed LAF.
if (skip) continue;
LookAndFeel laf = null;
try {
Class c = Class.forName(classname);
laf = (LookAndFeel)c.newInstance();
} catch (ClassNotFoundException e) {
// should not happen since we precisely looked in the classpath
} catch (InstantiationException e) {
// skip this laf
} catch (IllegalAccessException e) {
// skip this laf
}
if (laf==null) continue;
// Now check if the laf installed itself...
infos = UIManager.getInstalledLookAndFeels();
skip = false;
for (int i=0; i<infos.length; ++i) {
if (classname.equals(infos[i].getClassName())) skip = true;
}
// do not install already installed LAF.
if (skip) continue;
UIManager.installLookAndFeel(laf.getName(), classname);
}
// Save in the user properties
infos = UIManager.getInstalledLookAndFeels();
String property = null;