Link to home
Start Free TrialLog in
Avatar of SolangeRichard
SolangeRichardFlag for Canada

asked on

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.
Avatar of Mick Barry
Mick Barry
Flag of Australia image

What look and feel are you currently using?
Avatar of aozarov
aozarov

To set the native (windows in your case) look and feel see: http://javaalmanac.com/egs/javax.swing/LookFeelNative.html?l=rel
Avatar of SolangeRichard

ASKER

I'm using
UIManager.setLookAndFeel(
                    UIManager.getSystemLookAndFeelClassName());
or
UIManager.setLookAndFeel(
          "com.sun.java.swing.plaf.windows.WindowsLookAndFeel");


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.
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.
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia 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