Link to home
Start Free TrialLog in
Avatar of The14follower
The14follower

asked on

Setting Windows XP themes in java

Hi everyone,

I have been using the following technique to get Windows themes in my UI:

UIManager.setLookAndFeeL(UIManager.getSystemLookAndFeelClassName());

or

UIManager.setLookAndFeeL("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");

Both result in the themes for old windows environments.  Is there any way to get themes for Windows XP?
Avatar of zzynx
zzynx
Flag of Belgium image

I use the first one with success.
Sure you didn't choose for the classic view on that PC?
>> Sure you didn't choose for the classic view on that PC?
Do your other applications (e.g. the windows explorer) have the Windows XP look?
SOLUTION
Avatar of zzynx
zzynx
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of expertmb
expertmb

a separate jar is available for that
Avatar of The14follower

ASKER

Sorry for further questions.  I don't know how to do that.  What I do is to have my "Display Properties" in the "Themes" option set as "Windows XP (Modified)".

That was not enough to get it in my java applications.
So your other applications (e.g. the windows explorer) do have the Windows XP look?
Mr. zzynx
Yes, of course. Explorer has XP themes.
I am using JDK 1.4.0 and also JDK 1.4.2

Mr. expertmb
Where is the jar needed to do my task?
not tested this, searched not getting where this jar is.
looks-win-1.2.0.jar
>> I am using JDK 1.4.0 and also JDK 1.4.2
Make sure you run on the version 1.4.2 since the Windows XP look was introduced in that release.
(see: http://java.sun.com/docs/books/tutorial/uiswing/misc/plaf.html)
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Other interesting remark on that page:
If you are going to set the look and feel, you should do it as the very first step in your application.
Also make sure you don't have a swing.properties file (cf. same page + the forum link I posted before)
>>you should do it as the very first step in your application.
you can change the L&F after also
>> you can change the L&F after also
Of course (also mentioned on that page) but not with the code posted by the author.
And that was what I meant to say.
My JDK is now 1.4.0. I would try it tomorrow on 1.4.2 and see.
OK. We'll certainly hear from you ;°)
if that doesn't work, use the free JGoodies rar (www.jgoodies.com), it's ****ing great and beautiful,

greets belz
Thanks everyone for help.  I hope that grading was fair.
Thanks for accepting.