Create two file in same directory
1. Sapplet.java
2. Sapplet.htm
____________________________
... //1. Sapplet.java
import java.applet.Applet;
import java.awt.Color;
import java.awt.Graphics;
public class Sapplet extends Applet
{
String msg;
public void init()
{
setBackground(Color.green);
setForeground(Color.red);
msg="Inside init()...";
}
public void start()
{
msg+="inside Start()...";
}
public void paint(Graphics g)
{
msg+= "Inside Paint()..";
g.drawString(msg, 10, 30);
}
}
__________________________
2. Sapplet.htm
_______________________________
_______________________________
1. At Command line :- javac Sapplet.java
2. Right click on Sapplet.htm and Open with Firefox
3. Enzoy....
No comments:
Post a Comment