首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Exception >

setStub异常:java.lang.reflect.InvocationTargetException

2014-01-26 
我的applet中 有个setStub 调用,运行applet时候报告了异常: java.lang.reflect.InvocationTargetException

我的applet中 有个setStub 调用,运行applet时候报告了异常:

java.lang.reflect.InvocationTargetException
at java.awt.EventQueue.invokeAndWait(Unknown Source)
at test.Testap.init(Testap.java:40)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.security.AccessControlException: access denied (java.awt.AWTPermission setAppletStub)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.applet.Applet.setStub(Unknown Source)
at test.Testap.initComponents(Testap.java:65)
at test.Testap.access$0(Testap.java:57)
at test.Testap$1.run(Testap.java:42)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(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)


------解决方法--------------------------------------------------------
试试看
setStub(this);
------解决方法--------------------------------------------------------
java.awt.AWTPermission 
只有下面几个权限限制:
*  <td>accessClipboard </td>
*  <td>accessEventQueue </td>
*  <td>listenToAllAWTEvents </td>
*  <td>showWindowWithoutWarningBanner </td>
*  <td>readDisplayPixels </td>
*  <td>createRobot </td>
*  <td>fullScreenExclusive </td>
哥们用的JDK版本是多少呢?

        

热点排行