• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can't run my applet on a html page

 
Kitty Dayal
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wrote a small applet to load an image on the applet. Code..


The html code going with it is


This runs fine when it is run using appletviewer from command prompt. But when I try to load it on a browser it does not load and see
Loading Java Applet failed...

Please help

Thanks
Kits
 
Paul Santa Maria
Ranch Hand
Posts: 236
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry - as a security precaution, unsigned applets can't open local files.
 
Joe Ess
Bartender
Posts: 9318
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Get rid of the CODEBASE parameter in the HTML. Provided that the gif is in the same directory as the HTML it should work.
 
Shashank Agarwal
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It could also be possible that the browser might not recognize the version of jdk you are using to compile the file. Try this, compile the applet for a lower rated version. You can do this in the following manner. In the shell or Dos prompt, compile the applet by entering -

javac YourClassName.java -target 1.1

This creates the class according to JDK 1.1 specifications. It helped me solve a problem once, all the best to you.

Please tell what happened.
-------------------------------------------------------
Submit your java application/applets for reviewing. Find codes. Become a member today - www.thejavahub.com
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic