5B. Program to create an applet and draw grid line.
/*<applet code="GridLine.class" width=200 height=200></applet>*/
import java.awt.*;
import java.applet.*;
public class GridLine extends Applet
{
public void paint(Graphics g)
{
int r,c,x,y;
for(r=0;r<5;r++)
{
for(c=0;c<5;c++)
{
x=r*30;
y=c*30;
g.drawRect(x,y,30,30);
}
}
}
}
OUTPUT: