I am writing a checkers game for a class project and am stumped by a
bizarre error I cannot figure out.
My main class called Game, creates a board made up of Square objects.
The Square class extends JButton (because I want to associate the
Square's location on the board with two private variables (row and col)
in that class).
The constructors for Square are:
public class Square extends JButton
{
// class fields
private String pieceColor;
private boolean King;
private int row, col;
public Square()
{
super();
}
public Square(Icon Ic, int r, int c)
{
super(Ic);
row = r;
col = c;
pieceColor = "Blank";
King = false;
}
The Game class creates Square objects with the following code:
for(int j=0;j<8;j++)
{
Board[i][j]= new Square(blank,i,j);
.....
where blank is an Icon object.
Both classes compile just fine, but when I try to run the Game class, I
get this error:
----jGRASP exec: java checkers.Game
java.lang.VerifyError: (class: checkers/Game, method: <init> signature:
()V) Incompatible argument to function
Exception in thread "main"
----jGRASP wedge2: exit code for process is 1.
----jGRASP: operation complete.
I checked the API, but the documentation is not extensive for this
error. I am stumped.
Any thoughts or suggestions would be greatly appreciated.