| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 619 人关注过本帖
标题:[求助]编了一个五子棋程序,编译是通过了,但为什么运行时有空指针异常,不 ...
只看楼主 加入收藏
xhdwell
Rank: 1
等 级:新手上路
帖 子:124
专家分:0
注 册:2006-5-15
收藏
 问题点数:0 回复次数:2 
[求助]编了一个五子棋程序,编译是通过了,但为什么运行时有空指针异常,不懂啊!!
[求助]编了一个五子棋程序,编译是通过了,但为什么运行时有空指针异常,不懂啊!!
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)
这就是弹出的错误~~我是菜鸟看不懂~有谁能帮我找下错误吗?
YPDBPEGC.rar (67.59 KB) [求助]编了一个五子棋程序,编译是通过了,但为什么运行时有空指针异常,不懂啊!!


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

搜索更多相关主题的帖子: 五子棋 指针 编译 运行 
2006-07-08 19:47
千里冰封
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:灌水之王
等 级:版主
威 望:155
帖 子:28477
专家分:59
注 册:2006-2-26
收藏
得分:0 
at fivechessframe.MainPanel.paintComponent(MainPanel.java:45)
在你的程序第45行出现了空指针异常

可惜不是你,陪我到最后
2006-07-08 19:57
aiyuheng
Rank: 1
等 级:新手上路
威 望:1
帖 子:656
专家分:0
注 册:2006-1-12
收藏
得分:0 

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


when i want to ask anyone,i will ask myself first.
2006-07-08 20:04
快速回复:[求助]编了一个五子棋程序,编译是通过了,但为什么运行时有空指针异常 ...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.039873 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved