jQuery in Action, 3rd edition
The moose likes Applets and the fly likes load image: AccessControlException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "load image: AccessControlException" Watch "load image: AccessControlException" New topic

load image: AccessControlException

Edward Chen
Ranch Hand

Joined: Dec 23, 2003
Posts: 798
I want to load an image from remote website in JApplet. But I got error.

The coding is
image = Toolkit.getDefaultToolkit().getImage("http://news.bbc.co.uk/media/ddd.jpg");

The error message is

java.security.AccessControlException: access denied (java.io.FilePermission http://news.bbc.co.uk/m3body.jpg read)
at java.security.AccessControlContext.checkPermission(AccessControlConte
at java.security.AccessController.checkPermission(AccessController.java:
at java.lang.SecurityManager.checkPermission(SecurityManager.java:524)
at java.lang.SecurityManager.checkRead(SecurityManager.java:863)
at sun.awt.SunToolkit.getImageFromHash(SunToolkit.java:472)
at sun.awt.SunToolkit.getImage(SunToolkit.java:486)
at MyPaintApplet.init(MyPaintApplet.java:34)
at sun.applet.AppletPanel.run(AppletPanel.java:354)
at java.lang.Thread.run(Thread.java:534)


How could I solve this problem?
I agree. Here's the link: http://aspose.com/file-tools
subject: load image: AccessControlException
jQuery in Action, 3rd edition