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)?
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.
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.
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.