我有一個沉重的GUI應用程序。每次我啓動它,我從EventDispatchThread得到下面的堆棧跟蹤:調用Window.setVisible()時出現NullPointerException異常
14:30:04:115 >> java.lang.NullPointerException
at com.mercury.ftjadin.support.jfc11.cs.JTableCS$CellEditorListenerRegistrar.addListener(JTableCS.java:151)
at com.mercury.ftjadin.infra.abstr.ObjectCS.registerListeners(ObjectCS.java:2736)
at com.mercury.ftjadin.infra.DefaultCustomClassManager.onCreate(DefaultCustomClassManager.java:575)
at com.mercury.ftjadin.hooks.WToolkitHook.onCreate(WToolkitHook.java:23)
at java.awt.Toolkit.createComponent(Toolkit.java)
at java.awt.Component.addNotify(Component.java:6650)
at java.awt.Container.addNotify(Container.java:2565)
at javax.swing.JComponent.addNotify(JComponent.java:4693)
at javax.swing.JTable.addNotify(JTable.java:683)
at java.awt.Container.addNotify(Container.java:2576)
at javax.swing.JComponent.addNotify(JComponent.java:4693)
at java.awt.Container.addNotify(Container.java:2576)
at javax.swing.JComponent.addNotify(JComponent.java:4693)
at java.awt.Container.addNotify(Container.java:2576)
at javax.swing.JComponent.addNotify(JComponent.java:4693)
at java.awt.Container.addNotify(Container.java:2576)
at javax.swing.JComponent.addNotify(JComponent.java:4693)
at java.awt.Container.addNotify(Container.java:2576)
at javax.swing.JComponent.addNotify(JComponent.java:4693)
at java.awt.Container.addNotify(Container.java:2576)
at javax.swing.JComponent.addNotify(JComponent.java:4693)
at java.awt.Container.addNotify(Container.java:2576)
at javax.swing.JComponent.addNotify(JComponent.java:4693)
at java.awt.Container.addNotify(Container.java:2576)
at javax.swing.JComponent.addNotify(JComponent.java:4693)
at java.awt.Container.addNotify(Container.java:2576)
at javax.swing.JComponent.addNotify(JComponent.java:4693)
at javax.swing.JRootPane.addNotify(JRootPane.java:738)
at java.awt.Container.addNotify(Container.java:2576)
at java.awt.Window.addNotify(Window.java:664)
at java.awt.Frame.addNotify(Frame.java:470)
at java.awt.Window.show(Window.java:860)
at java.awt.Component.show(Component.java:1591)
at java.awt.Component.setVisible(Component.java:1543)
at java.awt.Window.setVisible(Window.java:843)
at ... my_classes_stack_trace
我試圖調試它在Java的源找到我做錯了什麼,什麼所需的對象是null
,但因爲我我被困沒有源com.mercury.ftjadin
包...
BTW,應用程序運行正常,無論這種例外,但我想無論如何要解決這個..
是任何人都熟悉這個問題?
你可以發佈代碼嗎?也許你有一個循環(在java.awt.Container.addNotify(Container.java:2576) 在javax.swing.JComponent.addNotify(JComponent.java:4693)) – alepuzio
正如我所說,這是一個沉重的GUI應用程序,包含(只有GUI部分)數十個類。問題是編寫第一個類時,我是一個總的java初學者,我可能會做一些糟糕的編程,現在我試圖追溯到。所以不行。我想發佈整個代碼是不可能的... – Elist
我會檢查您在GUI中使用的JTableCS,並檢查添加偵聽器是否有任何問題(如果您有權訪問它)。 – dARKpRINCE