[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Keep the classic Windows look and feel on Windows XP

Posted on 2005-04-05
Medium Priority
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
  • 3
  • 2
LVL 92

Expert Comment

ID: 13712473
What look and feel are you currently using?
LVL 15

Expert Comment

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

Author Comment

ID: 13716316
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.
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

LVL 15

Expert Comment

ID: 13716528
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

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

Accepted Solution

objects earned 1000 total points
ID: 13721718
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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses
Course of the Month19 days, 3 hours left to enroll

834 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