简体   繁体   English

如何设置JGoodies的外观和感觉?

[英]How to set the JGoodies Look and Feel?

I added the jgoodies-looks-2.5.3.jar to my buildpath and started it with 我将jgoodies-looks-2.5.3.jar到我jgoodies-looks-2.5.3.jar并启动它

public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {
            public void run() {
                try {
                    UIManager.setLookAndFeel("com.jgoodies.looks.windows.WindowsLookAndFeel");
                    ExpenseManagerGUI frame = new ExpenseManagerGUI();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });
    }

But I get the following Error: (How to fix this?) 但我得到以下错误:(如何解决这个问题?)

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: com/jgoodies/common/base/SystemUtils
    at com.jgoodies.looks.common.ShadowPopupFactory.install(ShadowPopupFactory.java:116)
    at com.jgoodies.looks.windows.WindowsLookAndFeel.initialize(WindowsLookAndFeel.java:199)
    at javax.swing.UIManager.setLookAndFeel(Unknown Source)
    at javax.swing.UIManager.setLookAndFeel(Unknown Source)
    at de.mayerhofersimon.expensemanager.ExpenseManagerGUI$2.run(ExpenseManagerGUI.java:94)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$200(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.jgoodies.common.base.SystemUtils
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 19 more

Looks very much like you're missing the jgoodies-common.jar on your classpath. 看起来非常像你错过了类路径上的jgoodies-common.jar。

You can get this from Maven 你可以从Maven得到这个

I would strongly recommend using a dependency management system for your build which should avoid these kinds of problems in the future 我强烈建议您为构建使用依赖关系管理系统,以避免将来出现这些问题

You are missing JGoodies Common library as shown on Maven Repository . 您缺少Maven Repository上显示的JGoodies Common库。 You can get it here . 你可以在这里得到它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM