Link to the code filesNullPointerException異常,同時創造一個JFrame
我創建了絕對佈局一個JFrame應用第一和Windows建設者改成了網格包佈局。現在,我得到這個錯誤:
java.lang.NullPointerException
at presentation.MainGUI.<init>(MainGUI.java:310)
at presentation.MainGUI$1.run(MainGUI.java:86)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:744)
at java.awt.EventQueue.access$400(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:697)
at java.awt.EventQueue$3.run(EventQueue.java:691)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:714)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
發佈您的代碼。 – 2014-10-05 11:06:49
我們不是你的專用調試器。當你遵循一些基本的調試步驟時,NPE很容易處理。 – Dici 2014-10-05 11:09:03