File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Applets and the fly likes cannot open applet in firefox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "cannot open applet in firefox " Watch "cannot open applet in firefox " New topic

cannot open applet in firefox

Phone Myat Kyaw
Ranch Hand

Joined: Dec 26, 2008
Posts: 31

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
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
There may be more than one causes for the exceptions, but start with this one:
Caused by: C:\Projects\HTP 6\WelcomeApplet\class.class (The system cannot find the path specified)
at 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 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.
I agree. Here's the link:
subject: cannot open applet in firefox
It's not a secret anymore!