• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 316
  • Last Modified:

Keep the classic Windows look and feel on Windows XP

My problem is...
My JTabbedPanes and My JButtons are not displaying the background color anymore. (worked with 1.4.1)

Windows XP and J2re1.4.2_05

I dont want to create icons for each of those panes and buttons but I need to set the the background to different colors from time to time.  Setting the foreground color is not sufficient.  

Also, the Windows look and feel is necessary,  Metal or Java are not acceptable.

Thank you.
  • 3
  • 2
1 Solution
What look and feel are you currently using?
To set the native (windows in your case) look and feel see: http://javaalmanac.com/egs/javax.swing/LookFeelNative.html?l=rel
SolangeRichardAuthor Commented:
I'm using

with the same result.  

The problem is it will set the XP look and feel and I want the classic Windows look and feel.
Basicaly I dont want the buttons and tabs  to hide the background color!

SetOpaque(false) wont work.
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

You can find/print your avaiable look and feel and pick something that sounds similar to what you are looking for:
 UIManager.LookAndFeelInfo[] info = UIManager.getInstalledLookAndFeels();
    for (int i=0; i<info.length; i++) {
        // Get the name of the look and feel that is suitable for display to the user
        String humanReadableName = info[i].getName();
        String className = info[i].getClassName();
        // The className is used with UIManager.setLookAndFeel()
        // See e867 Getting and Setting a Look and Feel
Classic windows look and feel is most likely not available on XP.
Looks like it is available, but by default the new xp look is used on XP.
To use old look try:

java -Dswing.noxp=true MyClass

Or set that system property in your code before setting L&F

System.setProperty("swing.noxp", "true");

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now