物质外观和感觉问题

时间:2011-04-24 12:57:17

标签: java swing swingx substance

我已经按实质内容下载了最近的库,并且我已经下载了插件以支持SwingX组件。运行我的应用程序时,我仍然收到以下错误

UIDefaults.getUI() failed: no ComponentUI class for:   org.jdesktop.swingx.JXTaskPaneContainer[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,bord  er=,flags=9,maximumSize=,minimumSize=,preferredSize=]  
java.lang.Error  
        at javax.swing.UIDefaults.getUIError(UIDefaults.java:711)  
        at javax.swing.MultiUIDefaults.getUIError(MultiUIDefaults.java:133)  
        at javax.swing.UIDefaults.getUI(UIDefaults.java:741)  
        at javax.swing.UIManager.getUI(UIManager.java:1017)  
        at org.jdesktop.swingx.plaf.LookAndFeelAddons.getUI(LookAndFeelAddons.java:308)  
        at org.jdesktop.swingx.JXTaskPaneContainer.updateUI(JXTaskPaneContainer.java:141)  
        at javax.swing.JPanel.<init>(JPanel.java:69)  
        at javax.swing.JPanel.<init>(JPanel.java:78)  
        at org.jdesktop.swingx.JXPanel.<init>(JXPanel.java:133)  
        at org.jdesktop.swingx.JXTaskPaneContainer.<init>(JXTaskPaneContainer.java:113)  
        at operator.table_browser.initComponents(table_browser.java:48)  
        at operator.table_browser.<init>(table_browser.java:33)  
        at forms_helper.form_objects.<clinit>(form_objects.java:71)  
        at Main$1.run(Main.java:53)  
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)  
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)  
        at   java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)  
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)  
        at   java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)  
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)  
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)  
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)  
Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError  
        at Main$1.run(Main.java:53)  
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)  
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)  
        at   java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)  
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)  
        at   java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)  
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)  
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)  
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)  
Caused by: java.lang.NullPointerException  
        at org.jdesktop.swingx.plaf.LookAndFeelAddons.getUI(LookAndFeelAddons.java:313)  
        at org.jdesktop.swingx.JXTaskPaneContainer.updateUI(JXTaskPaneContainer.java:141)  
        at javax.swing.JPanel.<init>(JPanel.java:69)  
        at javax.swing.JPanel.<init>(JPanel.java:78)  
        at org.jdesktop.swingx.JXPanel.<init>(JXPanel.java:133)  
        at org.jdesktop.swingx.JXTaskPaneContainer.<init>(JXTaskPaneContainer.java:113)  
        at operator.table_browser.initComponents(table_browser.java:48)  
        at operator.table_browser.<init>(table_browser.java:33)  
        at forms_helper.form_objects.<clinit>(form_objects.java:71)  
        ... 9 more

帮我解决这个问题!!

2 个答案:

答案 0 :(得分:3)

1.问题是您在EDT上正确添加了物质L&amp; F

f.e。

SwingUtilities.invokeLater(new Runnable() {

        @Override
        public void run() {
            try {
                UIManager.setLookAndFeel(new SubstanceOfficeSilver2007LookAndFeel());
                SwingUtilities.updateComponentTreeUI(frame);
            } catch (UnsupportedLookAndFeelException e) {
                throw new RuntimeException(e);
            }
        }
    });

答案 1 :(得分:0)

谢谢大家!!

我通过重置NetBeans缓存文件解决了这个问题:) NetBeans很奇怪有时......不得不经历一些完全不相关的问题.. :)