2014-02-19 54 views
7

我加入了jgoodies-looks-2.5.3.jar到我的構建路徑,並與如何設置JGoodies的外觀和感覺?

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(); 
       } 
      } 
     }); 
    } 

開始,但我得到以下錯誤:(?如何解決這個問題)

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 

回答

8

看起來非常像你錯過了jgoodies-common.jar在你的classpath上。

您可以從Maven

得到這個如圖on Maven Repository我會強烈建議使用你的構建的依賴管理系統,該系統應避免這類問題在未來

+0

我在哪裏可以得到它? – maysi

+0

答案更新了位置 – tddmonkey

5

你缺少的JGoodies公共圖書館。 你可以得到它here