【问题标题】:Unable to Set Java Look and Feel [closed]无法设置 Java 外观 [关闭]
【发布时间】:2014-11-05 07:43:46
【问题描述】:

我已经下载了一个 java 的外观。是夸夸。它以 ZIP 格式下载。我的问题是如何将这种外观添加到我的程序中?我正在使用 NetBeans 8。我用谷歌搜索并发现不合适的结果。 所以告诉我正确的程序。 谢谢。

【问题讨论】:

标签: java swing netbeans look-and-feel


【解决方案1】:

您像任何其他 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
         ...
     }
}

【讨论】:

    猜你喜欢
    • 2011-04-26
    • 2013-05-19
    • 2011-01-03
    • 1970-01-01
    • 2020-08-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多