• Post Reply Bookmark Topic Watch Topic
  • New Topic

load image: AccessControlException  RSS feed

Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!