Keep the classic Windows look and feel on Windows XP

Posted on 2005-04-05
Last Modified: 2010-08-05
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.
Question by:SolangeRichard
    LVL 92

    Expert Comment

    What look and feel are you currently using?
    LVL 15

    Expert Comment

    To set the native (windows in your case) look and feel see:

    Author Comment

    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.
    LVL 15

    Expert Comment

    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
    LVL 92

    Expert Comment

    Classic windows look and feel is most likely not available on XP.
    LVL 92

    Accepted Solution

    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");


    Featured Post

    Hire Top Freelancers to Complete Java Projects

    Source the talented Expert Exchange community
    for top quality work on your Java projects.

    Hire the best. Collaborate easily. Get quality work.

    Join & Write a Comment

    Suggested Solutions

    Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
    Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
    Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now