我的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版本是多少呢?