菜鸟求助 Unknown Source 怎么解决?

最后的莫西干人 2011-11-13 02:39:56
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at main.Login$1.actionPerformed(Login.java:110)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
...全文
11386 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
今早喝麦片 2012-03-21
  • 打赏
  • 举报
回复
有对象没有new就直接用了。
dracularking 2011-11-13
  • 打赏
  • 举报
回复
main.Login类中某个匿名内部类的actionPerformed方法中出现了null对象

不过这应该是个mouseRelease事件吧

/**
* Accept a mouse release event and set the button's
* "pressed" property to <code>true</code>, if the model
* is armed. If the model is not armed, ignore the event.
*
* @param e The mouse release event to accept
*/
public void mouseReleased(MouseEvent e)
{
if (e.getSource() instanceof AbstractButton)
{
AbstractButton button = (AbstractButton) e.getSource();
ButtonModel model = button.getModel();
if ((e.getModifiersEx() & InputEvent.BUTTON1_DOWN_MASK) != 0)
{
// It is important that these transitions happen in this order.
model.setPressed(false);
model.setArmed(false);
}
}
}
kouyiSC 2011-11-13
  • 打赏
  • 举报
回复
可以在myeclipse中将swing jar包关联到其源码上就行。。用处是:为了调试swing的内部api执行时用到。。。
kouyiSC 2011-11-13
  • 打赏
  • 举报
回复
引用
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)


这些Unknown source原因应该是,Login.java:110行的NullPointerException导致引用到swing包的api发生异常。。而swing的jar包没有关联到swing的源码。。。
magong 2011-11-13
  • 打赏
  • 举报
回复
[Quote=引用楼主 javierzanetti_4 的回复:]
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at main.Login$1.actionPerformed(Login.java:110)

[/Quote]
Login.java文件第110行有对象是Null的,仔细查查这里的代码。
hemingruanjian15 2011-11-13
  • 打赏
  • 举报
回复
这些Unknown source原因应该是,Login.java:110行的NullPointerException导致引用到swing包的api发生异常。。而swing的jar包没有关联到swing的源码。。。

67,512

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧