Trying to put an applet to work

Hi: From my java class, I am trying to, depending on the argument value, trying to loan an applet. My code is this :

if (argument.equals("return.html")){

//return an html doc to be displayed by the users Browser

xmlTest = "<apiResponse><htmlPage><!CDATA[><html><body><applet code=\"EntidadesAWT.class\" source=\"http://www.sat.gob.mx/ABM/app_version_4/\"></applet>This is an html page.</body></html>]]></htmlPage></apiResponse;

}

When I execute I get this error

java.lang.ClassNotFoundException: EntidadesAWT.class

at sun.applet.AppletClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.applet.AppletClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.applet.AppletClassLoader.loadCode(Unknown Source)

at sun.applet.AppletPanel.createApplet(Unknown Source)

at sun.plugin.AppletViewer.createApplet(Unknown Source)

at sun.applet.AppletPanel.runLoader(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Caused by: java.io.IOException: open HTTP connection failed.

at sun.applet.AppletClassLoader.getBytes(Unknown Source)

at sun.applet.AppletClassLoader.access$100(Unknown Source)

at sun.applet.AppletClassLoader$1.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

... 10 more

The Entidades.class is in Entidades.jar in the same directory as my class. Kindly advice.

Regards>

[1626 byte] By [BCOSTA_2007a] at [2007-11-27 11:57:52]
# 1

What are you doing?

You are running in an application and trying to launch an Applet?

Why?

You'll need to do this another way really.

cotton.ma at 2007-7-29 19:16:25 > top of Java-index,Java Essentials,New To Java...
# 2

Cause My class is an API hook

BCOSTA_2007a at 2007-7-29 19:16:25 > top of Java-index,Java Essentials,New To Java...
# 3

> Cause My class is an API hook

Please rephrase using less buzzwords you don't understand the meaning of.

cotton.ma at 2007-7-29 19:16:25 > top of Java-index,Java Essentials,New To Java...
# 4

Keep it simple... you want to run an applet. Your problem, removing all the other nonsense is your tag:

<applet code=\"EntidadesAWT.class\" source=\"http://www.sat.gob.mx/ABM/app_version_4/\"></applet>

First, source is not an applet tag parameter. You want to write HTML, then write proper HTML. If you want to use a jar, you need to define it, as well as a package, which your class should be in...

<applet code=\"com.pkg.EntidadesAWT.class\" codebase=\"http://www.sat.gob.mx/ABM/app_version_4/\" archive=\"Entidades.jar\" width=\"100\" height=\"100\"></applet>

bsampieria at 2007-7-29 19:16:25 > top of Java-index,Java Essentials,New To Java...
# 5

Hi BSAMPIERI: Thank you very much, with your explanation I understood what I have to do, which is the purpose of this forum.

10 points for you!!!

BCOSTA_2007a at 2007-7-29 19:16:25 > top of Java-index,Java Essentials,New To Java...