import java.awt.*; //use all awt package
import java.applet.*; //use applet package
public class Exm1 extends Applet //declaration of class
{
public void paint(Graphics g) //paint method
{
int x; //variable x
for(x=0;x<=200;x=x+10){ //for - next
g.drawLine(x,200,0,x); //drawing line
}
}
}
|
Exm1.html
<HTML> <HEAD> <TITLE>Exm1</TITLE> </HEAD> <BODY> <APPLET CODE="Exm1.class" WIDTH=200 HEIGHT=200></APPLET> </BODY> </HTML> |
Excercise 1b Create applets that draws the following figure.