public class Grid
{
private int columns;
private int rows;
private int appletWidth;
private int appletHeight;
private Graphics g;
public Grid(Graphics g, int appletWidth, int appletHeight)
{
this.appletWidth = appletWidth;
this.appletHeight = appletHeight;
this.columns = 0;
this.rows = 0;
this.g = g;
}
public void drawColumns()
{
for(int x = 0; x < this.appletWidth; x += 25)
{
g.drawLine(x, 0, x, this.appletHeight);
columns++;
}
}
public void drawRows()
{
for(int y = 0; y < this.appletHeight; y += 25)
{
g.drawLine(0, y, this.appletWidth, y);
rows++;
}
}
public int getColumnCount()
{
return this.columns;
}
public int getRowCount()
{
return this.rows;
}
}
Copyright © 2026, NextGenUpdate.
All Rights Reserved.