Hi I was wondering if anyone knows why I'm getting the reached end of file while parsing error. It mentions the bracket at the end of the file however when I remove it I get loads of errors. I know that I need to remove it however i dont understand why this error is occuring...
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
public class DrawPanel extends JPanel implements MouseListener
{
public int numCols;
public int numRows;
public DrawPanel(int nc, int nr)
{
numCols = nc;
numRows = nr;
addMouseListener(this);
}
int getCol(int x)
{
return x*newCol/getWidth();
}
int getRow(int y)
{
return y*newRow/getHeight();
}
public void mouseReleased(MouseEvent event)
{
}
public void mousePressed(MouseEvent event)
{
}
public void mouseClicked(MouseEvent event)
{
int thisCol = getCol(event.getX());
model.go(thisCol);
if(model.autoplay == 1)
{
System.out.println("Two Player game");
}
else if(model.autoplay == 2)
{
thisCol = model.getSuggestedMove(model.getNextPlayer());
model.go(thisCol);
}
else if(model.autoplay == 3)
{
thisCol = model.getSuggestedMove(model.getNextPlayer());
model.go(thisCol);
}
repaint();
}