Write a program that draws an 8-by-8 grid. Use draw Line method. ( File must be save as: Assignment10vi.java)
import java.awt.Graphics;
import java.applet.Applet;
public class Assignment10vi extends Applet
{
public void paint(Graphics g)
{
int i;
for (i=1; i<=9; i++)
{
g.drawLine(30,i*20,270,i*20);
//for (i=1; i<=9; i++)
g.drawLine(i*30,20,i*30,180);
}
}
}
////////////////////////////////////////////
Copy & paste this code in your Textpad & run, then you will get output.......
If you have any problem please comment below.........
Copy & paste this code in your Textpad & run, then you will get output.......
If you have any problem please comment below.........