• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

passing image file url from php to applet in java

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 43026
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
You showed up just in time for the waffles! And this 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
reply
    Bookmark Topic Watch Topic
  • New Topic