0

これが私のトレースバックです

Oct 9, 2012 3:58:44 PM org.jdesktop.application.Application$1 run
SEVERE: Application class sampleapp.SampeAppApp failed to launch
java.lang.NullPointerException
        at sampleapp.SampeAppView.<init>(MusicDownloaderView.java:89)
        at sampleapp.SampeAppApp.startup(MusicDownloaderApp.java:18)    
at org.jdesktop.application.Application$1.run(Application.java:171)
            at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
            at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:682)
            at java.awt.EventQueue.access$000(EventQueue.java:85)
            at java.awt.EventQueue$1.run(EventQueue.java:643)
            at java.awt.EventQueue$1.run(EventQueue.java:641)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:652)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Exception in thread "AWT-EventQueue-0" java.lang.Error: Application class musicdownloader.MusicDownloaderApp failed to launch
            at org.jdesktop.application.Application$1.run(Application.java:177)
            at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
            at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:682)
            at java.awt.EventQueue.access$000(EventQueue.java:85)
            at java.awt.EventQueue$1.run(EventQueue.java:643)
            at java.awt.EventQueue$1.run(EventQueue.java:641)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:652)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Caused by: java.lang.NullPointerException

また、私のマークされたすべての出現は

 jPanel1.removeAll();

89行目は

 jButton1.addActionListener(new ActionListener() {

これを解決する方法はありますか?また、ヘルプを見つけるためにオンラインで検索しましたが、何も見つかりませんでした。すべての回答をお待ちしております。前もって感謝します

4

2 に答える 2

0

コードをデバッグする必要があります。

基本的なNetbeansのデバッグ

Netbeansを使用したJavaアプリケーションのデバッグ

于 2012-10-09T13:31:47.473 に答える