views:

256

answers:

3

I want to give XP Look and Feel to my Java Desktop Appliction, regardless of the platform it will run.

I came to know that since JDK 1.4, Sun Microsystems has officially released a look and feel for XP - com.sun.java.swing.plaf.windows.WindowsLookAndFeel

I am using Java 1.6 but when I didn't find any package named windows in javax.swing.plaf package.

Q1. How can I use the XP Look and Feel?

Q2. Will using this look and feel will appear same on all platforms (mac, solaris, linux)?

+7  A: 

You can't. The XP look and feel, along with several of the other platform-flavoured look-and-feels, depends on native support from the actual platform. It can only be used on XP.

SamB
+1  A: 

Have a look at the JGoodies Library

It provides several Swing Look&Feel Styles that do not look exactly like the Windows Design but come close and sure look better that the typical Swing style.

FRotthowe
A: 

Because of the danger of "look and feel" law suites, the Window PL&F is only available on Windows and it checks the os.name system property to make sure..

It used to run on Linux okay. For XP it needs to look up skin information which wouldn't be present (same as the Gtk PL&F). And you probably shouldn't distribute this sort of thing.

http://www.jroller.com/tackline/entry/xp_pl_f_on_linux

Tom Hawtin - tackline
Does it also depend on native support as claimed by SamB, or is this simply a case of ducking a lawsuit? I would have thought, being Swing that it didn't depend on the native windowing widgets at all.
Adamski
Tom Hawtin - tackline