wood burning stoves 2.0*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Applet " Watch "Applet " New topic
Author

Applet

Divya Venkatesh
Greenhorn

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.
<html>
<title> GAME ! </title>
<head>
<body bgcolor="gray" text="white" >
<center>
<APPLET CODE="game1.class" WIDTH=600 HEIGHT=600>
</APPLET><br>
</center>
</body>
</head>
Is there any modification I have to do to this Code.
Please let me know
Thanks a lot


Divya
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1871
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
regards
maulin
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1871
btw,
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...
regards
maulin
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Applet
 
Similar Threads
jsp:include???
viewing applet in IE
Running applet in html page
My java applet program does not appear in appletviwere!!!
Error in loading Applet from JSP