XP laf not working with 1.4.2 & vista
I'm having trouble getting the XP look and feel on Vista with Java 1.4.2_14.
Buttons and toolbar buttons are the worst. They look like "classic windows" with ugly square borders.It's the same on most versions I've tried although 1.5.0_11 and 1.6 look fine.
Toolkit.getDefaultToolkit().getDesktopProperty("win.xpstyle.themeActive") returns null.
I'm not sure if this is relevant but I have to use sun.java2d.noddraw=true to avoid Vista switching to Basic Vista Basic Theme.
[502 byte] By [
jamjima] at [2007-11-27 4:40:42]

# 3
That's not really what I meant.
I've got a swing app running with Java 1.4.2_12 on Vista. The controls look like they are from windows classic.I would like them to look a bit like the native Vista controls.
When it runs on XP it looks like XP, when it runs on Linux it looks like metal, when it runs on Vista it looks rubbish.
# 6
they are Right it checks to see that the OS name is Windows XP i assume and it finds the windows but NOT the xp so it just assumes it is 98.... just my theroy
well not any more.!!! take a look and see ....
private static LookAndFeelInfo[] installedLAFs;
static {
ArrayList iLAFs = new ArrayList(4);
iLAFs.add(new LookAndFeelInfo(
"Metal", "javax.swing.plaf.metal.MetalLookAndFeel"));
iLAFs.add(new LookAndFeelInfo("CDE/Motif",
"com.sun.java.swing.plaf.motif.MotifLookAndFeel"));
// Only include windows on Windows boxs.
String osName = (String)AccessController.doPrivileged(
new GetPropertyAction("os.name"));
if (osName != null && osName.indexOf("Windows") != -1) {
iLAFs.add(new LookAndFeelInfo("Windows",
"com.sun.java.swing.plaf.windows.WindowsLookAndFeel"));
if (Toolkit.getDefaultToolkit().getDesktopProperty(
"win.xpstyle.themeActive") != null) {
iLAFs.add(new LookAndFeelInfo("Windows Classic",
"com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel"));
}
}
else {
// GTK is not shipped on Windows.
iLAFs.add(new LookAndFeelInfo("GTK+",
"com.sun.java.swing.plaf.gtk.GTKLookAndFeel"));
}
installedLAFs = (LookAndFeelInfo[])iLAFs.toArray(
new LookAndFeelInfo[iLAFs.size()]);
}
the OS is Windows but the XP theme is NOT on the computer!! so it goes back to cassic. hope this helps you,
ps that was code from UI Manager 1.5