0% found this document useful (0 votes)
6 views1 page

Java Applet Grid Line Drawing Code

The document contains a Java applet program that creates a grid of rectangles. It uses nested loops to draw a 5x5 grid with each rectangle measuring 30x30 pixels. The applet is designed to be displayed with a width and height of 200 pixels.

Uploaded by

priya
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

Java Applet Grid Line Drawing Code

The document contains a Java applet program that creates a grid of rectangles. It uses nested loops to draw a 5x5 grid with each rectangle measuring 30x30 pixels. The applet is designed to be displayed with a width and height of 200 pixels.

Uploaded by

priya
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

5B. Program to create an applet and draw grid line.

/*<applet code="[Link]" width=200 height=200></applet>*/


import [Link].*;
import [Link].*;
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;
[Link](x,y,30,30);
}
}
}
}
OUTPUT:

You might also like