...

View Full Version : embedding applets with the web browser



Aymen++
03-31-2004, 05:29 AM
i have java creator (JCreator), and i started a new applet, after compiling and executing, JCreator created a folder named with the same name of the applet and contains the web page that supposed to view the applet and the applet class also, when i wanted to view the web page the applet didn't appear? why?
this is the .java code:


import java.awt.*;
import java.applet.*;


public class Aymen extends Applet {

public void init() {
}

public void paint(Graphics g) {
g.drawString("This is the first applet", 50, 60 );
}
}

and this is the html code:


<HTML>
<HEAD>
</HEAD>
<BODY>
<CENTER>
<APPLET
code = "Aymen.class"
width = "500"
height = "300"
>
</APPLET>
</CENTER>
</BODY>
</HTML>

smeagol
03-31-2004, 02:27 PM
Hello,

This worked for me. Make sure you have the Aymen.class file in the same directory as the Aymen.html page.

Aymen++
04-02-2004, 09:51 AM
ya, i'm sure that the Aymen.class is in the same folder with the htm file :confused:

Aymen++
04-02-2004, 10:03 AM
and i uploaded the files and you can see them here:
http://www.members.lycos.co.uk/aymenplusplus/HoverButton.htm
and:
http://www.members.lycos.co.uk/aymenplusplus/HoverButton.class
and:
http://www.members.lycos.co.uk/aymenplusplus/recPane.class



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum