Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 549
  • Last Modified:

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?
0
The14follower
Asked:
The14follower
  • 11
  • 4
  • 4
  • +1
2 Solutions
 
zzynxSoftware engineerCommented:
I use the first one with success.
Sure you didn't choose for the classic view on that PC?
0
 
zzynxSoftware engineerCommented:
>> 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?
0
 
zzynxSoftware engineerCommented:
What JDK are you using?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
zzynxSoftware engineerCommented:
0
 
expertmbCommented:
a separate jar is available for that
0
 
The14followerAuthor Commented:
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.
0
 
zzynxSoftware engineerCommented:
So your other applications (e.g. the windows explorer) do have the Windows XP look?
0
 
The14followerAuthor Commented:
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?
0
 
expertmbCommented:
not tested this, searched not getting where this jar is.
looks-win-1.2.0.jar
0
 
zzynxSoftware engineerCommented:
>> 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)
0
 
expertmbCommented:
JDK 1.4.2
has win xp L&F.
0
 
zzynxSoftware engineerCommented:
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.
0
 
zzynxSoftware engineerCommented:
Also make sure you don't have a swing.properties file (cf. same page + the forum link I posted before)
0
 
expertmbCommented:
>>you should do it as the very first step in your application.
you can change the L&F after also
0
 
zzynxSoftware engineerCommented:
>> 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.
0
 
The14followerAuthor Commented:
My JDK is now 1.4.0. I would try it tomorrow on 1.4.2 and see.
0
 
zzynxSoftware engineerCommented:
OK. We'll certainly hear from you ;°)
0
 
b3lzCommented:
if that doesn't work, use the free JGoodies rar (www.jgoodies.com), it's ****ing great and beautiful,

greets belz
0
 
The14followerAuthor Commented:
Thanks everyone for help.  I hope that grading was fair.
0
 
zzynxSoftware engineerCommented:
Thanks for accepting.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 11
  • 4
  • 4
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now