Win a copy of Kotlin for Android App Development this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Applet can't load gif image  RSS feed

 
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 ]
 
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.
 
Bring out your dead! Or a tiny ad:
Programmatically Create PDF Using Free Spire.PDF with Java
https://coderanch.com/wiki/703735/Programmatically-Create-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!