Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

passing image file url from php to applet in java

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 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. permission exception
'm really facing a big problem to solve this issueu
Posts: 43016
  • 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 page for how that's done.
You’ll find me in my office. I’ll probably be drinking. And reading this tiny ad.
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic