File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Applet " Watch "Applet " New topic


Divya Venkatesh

Joined: Nov 05, 2002
Posts: 28
When i try to run my program as an Applet the Applet gives me "Security Exception" for any image and Image icons in my program and does not load at all.
Is there anyway by which I can set the path to the directory where my Images are Stored.
Here is the Applet code I am using.
<title> GAME ! </title>
<body bgcolor="gray" text="white" >
<APPLET CODE="game1.class" WIDTH=600 HEIGHT=600>
Is there any modification I have to do to this Code.
Please let me know
Thanks a lot

Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1873
hi Divya
u can make a JAR file having your applet class and images and then use ARCHIVE attribute of the Applet HTML Tag in this way...
<applet code='yourapplet.class' archive='yourjarfile.jar'....>
u can go to following URL for help about the Image in the applet if thats what u want...
SUN Tutorial
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1873
how r u using images in ur applet?
also look at the Applet API as it says that getImage() of Applet returns immediately even if the image is not loaded yet...
I agree. Here's the link:
subject: Applet
It's not a secret anymore!