Thursday 10 November 2016

APPLET PROGRAM



Java Code:
import java.awt.*;
import java.applet.*;
public class MyApplet extends Applet
{
 String str;
 public void init()
 {
  str="My First applet program";
 }
 public void paint(Graphics g)
 {
  g.drawString(str,20,20);
 }
}

HTML Code:
<HTML>
<HEAD>
<TITLE>My Applet Code</TITLE>
</HEAD>
<BODY>
<APPLET CODE=MyApplet.class
        WIDTH=500
        HEIGHT=400>
</APPLET>
</BODY>
</HTML>

No comments:
Write comments