Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Applet

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Screaming fools! It's nothing more than a tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic