Re: Is it possible to know if windows is in XP style or classic style ?
- From: Thomas Kellerer <OTPXDAJCSJVU@xxxxxxxxxxxxx>
- Date: Mon, 07 Dec 2009 18:34:03 +0100
Albert wrote on 07.12.2009 17:52:
Hi, i'd like to use to some feature not present in windows classic style. So i need to change some parts of my GUI depending on that.
Is there a way to know if windows is in XP style or classic style ?
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;
}
}
}
}
.
- References:
- Prev by Date: Is it possible to know if windows is in XP style or classic style ?
- Next by Date: Re: Sequence of events invoking methods from a tree model
- Previous by thread: Is it possible to know if windows is in XP style or classic style ?
- Next by thread: Re: Is it possible to know if windows is in XP style or classic style ?
- Index(es):