Applet - 浏览器关闭时的'java.lang.NullPointerException:null pData'

时间:2008-10-22 15:23:19

标签: java applet nullpointerexception

我有一个用户在关闭浏览器时收到错误消息。这只有在他访问了包含我的applet的页面时才会发生。它似乎已被注册为Sun的一个bug,但那是很多年前的事了。他正在使用Java 1.6和IE7。

以前是否有人见过这个并知道解决方案或解决方法?

java.lang.NullPointerException: null pData
    at sun.awt.windows.WComponentPeer.hide(Native Method)
    at java.awt.Component.removeNotify(Unknown Source)
    at java.awt.Container.removeNotify(Unknown Source)
    at java.awt.Container.removeNotify(Unknown Source)
    at java.awt.Container.removeAll(Unknown Source)
    at sun.plugin.viewer.frame.IExplorerEmbeddedFrame.windowClosed(Unknown Source)
    at java.awt.Window.processWindowEvent(Unknown Source)
    at java.awt.Window.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(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)

更新用户已删除Google桌面,此后未发生此问题。所以,你去...谢谢大家!

3 个答案:

答案 0 :(得分:1)

我过去常常为浏览器中加载的每个applet获取该错误。我从来没有想过如何,但Google桌面在某种程度上打破了java。卸载谷歌桌面后,错误就消失了。

答案 1 :(得分:1)

我不知道解决方案,但我知道预防这个问题。 如果在您的Web浏览器中启用了javascript,则将此代码放在打开小程序的html文件的head标记内的脚本标记中:

<SCRIPT language = "JavaScript">
    window.onunload = function() { document.body.innerHTML = ""; } 
</script>

答案 2 :(得分:0)

你有没有试过1.6u10?它上周发布,据说修复了一些applet问题。否则,他们使用的是什么版本的1.6?