In class my teacher ran a program similar to this one. When I attempt to run this from home I get a message saying "No main classes found". I know there should be a main in the program but he ran a similar program without it. Just trying to get some insight on how to run this. This is basically just a program that makes a checkerboard pattern then it draws the checkers on top.
package checkers1;
import java.awt.*;
public class Checkers1 {
static
int columns = 8;
int rows = 8;
int sizeofsquare = 50;
void maketheboard(Graphics g) {
for(int row = 0; row<rows; row++)
for(int column = 0; column<columns; column++){
if((row+column)% 2==0)
{
g.setColor(Color.LIGHT_GRAY);
}
else
g.setColor(Color.GRAY);
g.fillRect(20+column*sizeofsquare,20+row*sizeofsquare,
sizeofsquare,sizeofsquare);
}
}
private void checkerTime(Graphics g) {
for(int row = 0; row<rows; row++)
for(int column = 0; column<columns; column++)
if((row+column)% 2==1)
if (row <3)
{
g.setColor(Color.white);
g.fillOval(20+column*sizeofsquare, 20+row*sizeofsquare,
sizeofsquare-2, sizeofsquare-2);
if (row >= rows -3)
{
g.setColor(Color.black);
g.fillOval(20+column*sizeofsquare,20+row*sizeofsquare,
sizeofsquare-2, sizeofsquare-2);
}
}
}
public void draw(Graphics g)
{
maketheboard(g);
checkerTime(g);
}
}