aspose file tools*
The moose likes Applets and the fly likes Can't run my applet on a html page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Can Watch "Can New topic
Author

Can't run my applet on a html page

Kitty Dayal
Ranch Hand

Joined: Jul 22, 2004
Posts: 89
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

Joined: Feb 24, 2004
Posts: 236
Sorry - as a security precaution, unsigned applets can't open local files.


Paul M. Santa Maria, SCJP
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8964
    
    9

Get rid of the CODEBASE parameter in the HTML. Provided that the gif is in the same directory as the HTML it should work.


[How To Ask Questions On JavaRanch]
Shashank Agarwal
Ranch Hand

Joined: May 20, 2004
Posts: 105
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can't run my applet on a html page