0

So I have this applet which loads images from a directory but it looks like Java is giving me some permission issues. I am a newbie when it comes to making applets on the web and tried to find solutions but most involve either command prompt or terminal access to the server hosting to the page. I don't have access to that. (Running on GoDaddy shared hosting)

java.lang.reflect.InvocationTargetException
    at com.sun.deploy.util.DeployAWTUtil.invokeAndWait(DeployAWTUtil.java:116)
    at sun.plugin2.applet.Plugin2Manager.runOnEDT(Plugin2Manager.java:3541)
    at sun.plugin2.applet.Plugin2Manager.createApplet(Plugin2Manager.java:3072)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Plugin2Manager.java:1497)
    at java.lang.Thread.run(Thread.java:680)
Caused by: java.security.AccessControlException: access denied (java.io.FilePermission ./setup/USPresidentialSeal.png read)
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
    at java.security.AccessController.checkPermission(AccessController.java:546)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
    at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
    at java.io.File.canRead(File.java:689)
    at javax.imageio.ImageIO.read(ImageIO.java:1274)

I have a PNG image located at

setup/USPresidentialSeal.png

Any help would be appreciated. (Also I am getting this error while running the applet from a HTML file located on my desktop.

4

1 回答 1

2

By default, applets do not have access to your local file system.

How can an applet Read/Write files on the local file-system?

于 2012-04-22T18:09:39.027 回答