【发布时间】:2014-11-05 07:43:46
【问题描述】:
我已经下载了一个 java 的外观。是夸夸。它以 ZIP 格式下载。我的问题是如何将这种外观添加到我的程序中?我正在使用 NetBeans 8。我用谷歌搜索并发现不合适的结果。 所以告诉我正确的程序。 谢谢。
【问题讨论】:
-
“告诉我正确的程序”。不,我们不会,除非您告诉我们您实际尝试过什么。
标签: java swing netbeans look-and-feel
我已经下载了一个 java 的外观。是夸夸。它以 ZIP 格式下载。我的问题是如何将这种外观添加到我的程序中?我正在使用 NetBeans 8。我用谷歌搜索并发现不合适的结果。 所以告诉我正确的程序。 谢谢。
【问题讨论】:
标签: java swing netbeans look-and-feel
您像任何其他 lib 一样将 jar 文件添加到类路径,并且在显示您的 JFrame 之前,您像这样设置 lnf:
UIManager.setLookAndFeel(quaqualnf);
...
JFrame frame = ...
如果您费心查看开发指南,您会发现:
public class MyApplication {
public static void main(String[] args) {
// set system properties here that affect Quaqua
// for example the default layout policy for tabbed
// panes:
System.setProperty(
"Quaqua.tabLayoutPolicy","wrap"
);
// set the Quaqua Look and Feel in the UIManager
try {
UIManager.setLookAndFeel(
ch.randelshofer.quaqua.QuaquaManager.getLookAndFeel();
);
// set UI manager properties here that affect Quaqua
...
} catch (Exception e) {
// take an appropriate action here
...
}
// insert your application initialization code here
...
}
}
【讨论】: