我已经下载了java的外观。它是夸。它是以ZIP格式下载的。我的问题是如何将这种外观添加到我的程序中?我正在使用NetBeans 8。我在谷歌上搜索了一下,结果不合适。所以告诉我正确的程序。谢谢
您像任何其他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
...
}
}