Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

load image: AccessControlException

 
Edward Chen
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
xt.java:269)
at java.security.AccessController.checkPermission(AccessController.java:
401)
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic