[java] Applet Security Problem

Started by
1 comment, last by janoside 17 years, 11 months ago
I'm new to Applets and I would like to make an applet that will allow visitors to my site to view a slideshow of images. I want the applet to load all image files that are in the same directory as the applet (on my server). How can I do it? I understand that applets have a lot of security implications, but it seems like I should be able to read a local file. Currently I am getting the following error message: java.security.AccessControlException: access denied (java.util.PropertyPermission user.dir read). Any help is appreciated.
-janoside [Firestorm Engine]
Advertisement
Because the applet is running on the user's machine, "local files" actually means the files on the user's machine, which (correctly) applets can't get access to without being signed and so forth.

What you can do is load the images from your server instead. I can't remember off the top of my head, but if I'm sure there'll be a tutorial on the Sun site.
Thanks bleb, that really helps. I didn't realize it was running on the user's computer. If anyone knows of a good demo showing an applet loading server-side files I would appreciate a link.

Thanks
-janoside [Firestorm Engine]

This topic is closed to new replies.

Advertisement