如何获得操作系统的外观 &感觉在 Java 7 中? [英] How to get the Operating System's Look & Feel in Java 7?

查看:19
本文介绍了如何获得操作系统的外观 &感觉在 Java 7 中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Netbeans 7.1 IDE 编写 Java 7.从 Java 1.7 包开始,他们在他们的应用程序中使用了一个新主题.

I am coding Java 7 with the Netbeans 7.1 IDE. From the Java 1.7 package they are using a new theme in their applications.

我该怎么做才能使我的应用程序的主题与操作系统的主题完全一致(即,如果我使用的是 Ubuntu,我希望我的程序的外观和感觉与 Ubuntu 的一样)?

What can I do to make my application's theme exactly the theme in operating system (i.e. if I am using Ubuntu, I want the look and feel of my program to be the that of Ubuntu's)?

推荐答案

我觉得这对 SO 来说更像是一个问题,但简而言之,您应该尝试以下操作:

I feel that this is more a question for SO, but in short you should try something like :

UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

这篇关于如何获得操作系统的外观 &感觉在 Java 7 中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆