Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

passing image file url from php to applet in java

 
Rajesh Sakthivel
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

i can call a image file using applet.html - paramter .but its works fine by giving the full url path say (c:/temp/e.jpg).
not working for the relative
URL Path.it works for Absolute path.


eg: 1)<pram name="backgroundA" value="c:/temp/e.jpg" /> works fine

2)i have moved the .jpg file to the same folder where the applet.html present.
<param name="backgroundA" value="e.jpg" />not working, it says cant read the file are jav.
a.io.read/write permission exception
'm really facing a big problem to solve this issueu
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

For security reasons, applets can't access the local file system unless they are signed; that's why you can't use classes like File and FileInputStream.

The way to access images that are in the same directory as the HTML file containing the applet tag is to use the Applet.getImage method. See the LoadAGif example in the http://faq.javaranch.com/java/CodeBarnApplets page for how that's done.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic