当前位置: 代码迷 >> Java相关 >> [求助]编了一个五子棋程序,编译是通过了,但为什么运行时有空指针异常,不 ...
  详细解决方案

[求助]编了一个五子棋程序,编译是通过了,但为什么运行时有空指针异常,不 ...

热度:260   发布时间:2006-07-08 19:47:20.0
[求助]编了一个五子棋程序,编译是通过了,但为什么运行时有空指针异常,不懂啊!!
[求助]编了一个五子棋程序,编译是通过了,但为什么运行时有空指针异常,不懂啊!!
java.lang.NullPointerException
at fivechessframe.MainPanel.paintComponent(MainPanel.java:45)
at javax.swing.JComponent.paint(JComponent.java:808)
at javax.swing.JComponent.paintChildren(JComponent.java:647)
at javax.swing.JComponent.paint(JComponent.java:817)
at javax.swing.JComponent.paintChildren(JComponent.java:647)
at javax.swing.JComponent.paint(JComponent.java:817)
at javax.swing.JLayeredPane.paint(JLayeredPane.java:557)
at javax.swing.JComponent.paintChildren(JComponent.java:647)
at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4794)
at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4740)
at javax.swing.JComponent.paint(JComponent.java:798)
at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:21)
at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:60)
at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:97)
at java.awt.Container.paint(Container.java:1312)
at sun.awt.RepaintArea.paint(RepaintArea.java:177)
at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:260)
at java.awt.Component.dispatchEventImpl(Component.java:3678)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
这就是弹出的错误~~我是菜鸟看不懂~有谁能帮我找下错误吗?

[此贴子已经被作者于2006-7-8 19:47:49编辑过]

搜索更多相关的解决方案: 五子棋  指针  编译  运行  

----------------解决方案--------------------------------------------------------
at fivechessframe.MainPanel.paintComponent(MainPanel.java:45)
在你的程序第45行出现了空指针异常

----------------解决方案--------------------------------------------------------

都能编五子棋了,还说自己是菜鸟,还不能自己找错么?


----------------解决方案--------------------------------------------------------
  相关解决方案