• 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

cannot open applet in firefox

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I can't test my applet programs in Firefox though it can run using appletviewer in cmd prompt or Netbeans IDE.



I think it's caused by Security reason because the class I'm testing uses "/images" folder from its current direction. When I test simple programs like HelloWorld.class, it's fine.
Hence, can someone advise how I can give assessment to use its subfolder to be displayed in browser/appletviewer ?

thanks in advance
 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There may be more than one causes for the exceptions, but start with this one:

Caused by: java.io.FileNotFoundException: C:\Projects\HTP 6\WelcomeApplet\class.class (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)


Applets can't use file I/O due to security reasons. To access files on the server you need to go a somewhat more complicated route. The http://faq.javaranch.com/java/CodeBarnApplets page has an example of how to do that; it's called HelloServerFile. It uses readers instead of the streams you're using, but you should have little problems rewriting it.
 
Grow a forest with seedballs 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
    Bookmark Topic Watch Topic
  • New Topic