JApplet error on Browser

I have put together a class that extends from japplet; i ran it on appletviewer an the applet works ok; however, when i call the applet from a browser using html's <applet> it doesn't find the applet (the status bar of the browser says .class SSS not found). i know that it isn't a location problem because the .class file is on the same directory as the html script calling.

Could any one tell me what is my mistake and how to fix it?

thanks,

cesar

[501 byte] By [cesarloo] at [2007-9-26 1:34:18]
# 1

your problem is in your HTML. You need to either write your HTML with the appropriate Object or Embed tags, or use SUN's HTML converter to do it for you. I would recommend using the HTML converter. Thats what I use. Just go to search SUN's site for HTML Converter Plug-In. Its really easy to use. For an example of exaclty what it does look below.

Before Conversion:

<APPLET CODE = "myAppletclass" ARCHIVE = "SmyAppletjar" WIDTH = 400 HEIGHT = 400>

<PARAM NAME = file VALUE ="/etc/inet/hosts">

</APPLET>

-->

After Conversion:

<!--"CONVERTED_APPLET"-->

<!-- CONVERTER VERSION 1.3 -->

<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"

WIDTH = 400 HEIGHT = 400 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0">

<PARAM NAME = CODE VALUE = "myAppletclass" >

<PARAM NAME = ARCHIVE VALUE = "SmyAppletjar" >

<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3">

<PARAM NAME="scriptable" VALUE="false">

<PARAM NAME = file VALUE ="/etc/inet/hosts">

<COMMENT>

<EMBED type="application/x-java-applet;version=1.3" CODE = "myAppletclass" ARCHIVE = "SmyAppletjar" WIDTH = 400 HEIGHT = 400 file = "/etc/inet/hosts" scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED></COMMENT>

</NOEMBED></EMBED>

</OBJECT>

<!--

<APPLET CODE = "myAppletclass" ARCHIVE = "SmyAppletjar" WIDTH = 400 HEIGHT = 400>

<PARAM NAME = file VALUE ="/etc/inet/hosts">

</APPLET>

-->

<!--"END_CONVERTED_APPLET"-->

-

You probably have it the first way. The second way is the correct way for it to come up in your IE browser.

HTML converter also converts HTML for other browsers besides IE.

hope this helps

armandfcdx at 2007-6-29 2:17:12 > top of Java-index,Archived Forums,Java Programming...
# 2
Yes it did solve this problem, thanks, cesar
cesarloo at 2007-6-29 2:17:12 > top of Java-index,Archived Forums,Java Programming...