Problem with displaying applet in webpage

Dear All

I have developed my first applet test as follows :

HelloWorldApplet.java :

import java.awt.Graphics;

publicclass HelloWorldAppletextends java.applet.Applet{

publicvoid paint(Graphics g){

g.drawString("Hello World!",5,25);

}

}

HelloWorldApplet.htm:

<HTML>

<HEAD>

<TITLE> Hello to Everyone !! </TITLE>

</HEAD>

<BODY>

<P> My Java Applet says :

<APPLET CODE="HelloWorldApplet.class" WIDTH=150 HEIGHT=25>

</APPLET>

</BODY>

</HTML>

After using javac HelloWorldApplet.java , the class is successfully created.

All 3 files (HelloWorldApplet.java , HelloWorldApplet.class and HelloWorldApplet.htm) are in the same folder.

If I open the webpage to see and test the applet , I just see the placeholder and a message is displayed in the status bar of Internet Explorer "class HelloWorldApplet not found".

If I use applet viewer , I am able to see the applet running.

I am using win xp professional.

Also I have tried many other small applets , and I face the same problem : I can see them in appletviewer but not the webpage.

Could you please tell me what could be wrong ? why I am able to see the applet in applet viewer but not the webpage ?

Thank you in advance

Evrim

Message was edited by:

Evrim

[1845 byte] By [Evrima] at [2007-10-2 22:13:44]
# 1

import java.awt.Graphics;

import java.applet.Applet;

public class HelloWorldApplet extends Applet

{

public void paint(Graphics g)

{

g.drawString("Hello World!",5,25);

}

}

that works jsut fine for me...

<HTML>

<HEAD>

<TITLE>Applet HTML Page</TITLE>

</HEAD>

<BODY>

<!--

*** GENERATED applet HTML launcher - DO NOT EDIT IN 'BUILD' FOLDER ***

If you need to modify this HTML launcher file (e.g., to add applet parameters),

copy it to where your applet class is found in the SRC folder. If you do this,

the IDE will use it when you run or debug the applet.

Tip: To exclude an HTML launcher from the JAR file, use exclusion filters in

the Packaging page in the Project Properties dialog.

For more information see the online help.

-->

<H3><HR WIDTH="100%">Applet HTML Page<HR WIDTH="100%"></H3>

<P>

<APPLET codebase="classes" code="HelloWorldApplet.class" width=350 height=200></APPLET>

</P>

<HR WIDTH="100%"><FONT SIZE=-1><I>Generated by NetBeans IDE</I></FONT>

</BODY>

</HTML>

PlasmaLinka at 2007-7-14 1:30:36 > top of Java-index,Java Essentials,New To Java...