• Post Reply Bookmark Topic Watch Topic
  • New Topic

Applet can't load gif image  RSS feed

 
Kurnaf Naem
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,
I am sure this must be in a FAQ somewhere but I did a search here and though this question has been asked once, there has been no 'solution'.
I have been writing a java application (which runs fine) and decided to convert it into an applet but ran into file reading problems. I am trying to simply load a 'gif' image but I get the following error when I try to load the applet:
java.security.AccessControlException: access denied (java.io.FilePermission someimage.gif read)
The class, 'gif' file and html page are all in the same directory. I get the same error loading the applet from a local directory or a server, using absolute or relative URL. I get the error even if I use a jar file.
Here is the line that tries to read the gif file:
ImageIcon cardImage = new ImageIcon("someimage.gif");
[ February 07, 2002: Message edited by: kurnaf ]
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kurnaf,
Look at the following link. It seems to be a fix for your exact problem.
http://www.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=23&t=000060
NOTE: Your chosen name is not a valid user name here at the Ranch. We require a first name + space + last name so we can keep a professional atmosphere. Please read the naming convention here.
Regards,
Manfred.
 
Kurnaf Naem
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Manfred for the pointer.
Sorry about the choice of nicks. Didn't pay attention to the fine print.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!