我正在用 java swing 构建一个应用程序,我正在使用以下代码为 UI 提供原生操作系统外观
try {
UIManager.setLookAndFeel(
UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
e.printStackTrace();
}
在 OS X 上,外观很好,但在 Windows(XP 和 7)上,按钮看起来像这样。
替代文字 http://img710.imageshack.us/img710/8735/buttonsoc.png
我在其他项目上使用了完全相同的代码,它工作正常。但是在这个特定的项目中,我得到了完全不同的外观。
我正在使用 Java 1.6
提前致谢!