Swing UI does not support OS appearance

I am creating an application in java swing and I am using the following code to give the user interface the look of the OS.

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

In OS X, the look is beautiful, but in windows (XP and 7) the buttons look like this.

alt text http://img710.imageshack.us/img710/8735/buttonsoc.png

I used this exact code for other projects and it works great. But in this particular project, I get a completely different look.

I am using Java 1.6

Thanks in advance!

+5
source share
1 answer

, , L & F? JButton , UI L & F , .

, Mac (L & F Mac Apple JVM IIRC), Windows. , L & F ( , GUI, ).

+8

All Articles