Is there a way to know if windows is in XP style or classic style ?
Thanks
This works for me:
String clsname = UIManager.getLookAndFeel().getClass().getName();
boolean isWindowsClassic = false;
if (clsname.indexOf("com.sun.java.swing.plaf.windows") > -1)
{
String osVersion = System.getProperty("os.version", "1.0");
Float version = Float.valueOf(osVersion);
if (version.floatValue() <= 5.0)
{
isWindowsClassic = true;
}
else
{
isWindowsClassic = (clsname.indexOf("WindowsClassicLookAndFeel") > -1);
if (!isWindowsClassic)
{
Toolkit toolkit = Toolkit.getDefaultToolkit();
Boolean themeActive = (Boolean) toolkit.getDesktopProperty("win.xpstyle.themeActive");
if (themeActive != null)
{
isWindowsClassic = !themeActive.booleanValue();
}
else
{
isWindowsClassic = true;
}
}
}
}
>Is there a way to know if windows is in XP style or classic style ?
Do you mean the Java L&F or Windows itself.
If the L&F see http://mindprod.com/jgloss/laf.html
If you mean windows, you will have to figure out how to do it in C,
and write some JNI glue.
see http://mindprod.com/jgloss/jni.html
--
Roedy Green Canadian Mind Products
http://mindprod.com
The future has already happened, it just isn�t evenly distributed.
~ William Gibson (born: 1948-03-17 age: 61)
Sorry, i didn't answer to Thomas Keller, but his trick works for me.