Swing UI does not have native OS look

Posted by Virat Kadaru on Stack Overflow See other posts from Stack Overflow or by Virat Kadaru
Published on 2010-06-08T17:07:53Z Indexed on 2010/06/08 17:12 UTC
Read the original article Hit count: 226

Filed under:
|
|
|

I am building an application in java swing and I am using the following code to give the UI a native OS look

try {
  UIManager.setLookAndFeel(
    UIManager.getSystemLookAndFeelClassName());
  } catch (Exception e) {
    e.printStackTrace();
}

On a OS X, the look is fine, but on windows (XP and 7) the buttons look like this.

alt text

I have used this exact same code on other projects and it works fine. But in this particular project I get a completely different look.

Thanks in advance!

© Stack Overflow or respective owner

Related posts about java

Related posts about swing