I am trying to build a chess board, but I keep getting an error that I can not seem to fix.
I have tried to find what it could be, but I am just lost.
my code:
import java.awt.*;
import javax.swing.*;
import javax.swing.event.*;
public class chess extends JFrame {
int column_want, column_curr, column_diff;
int row_want, row_curr, row_diff;
public static void main(String[] args) {
System.out.println("Welcome to java");
board frame = new boardLayout();
frame.setSize(500, 500);
frame.setTitle("chess Board");
frame.setLocationRelativeTo(null); //center of frame
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
public void boardLayout() {
JPanel board = new JPanel(new GridLayout(6,5,1,1)); // gridLayout (row, column, hgap, vgap)
add(board, BorderLayout.NORTH);
}
}
it claims to be on line 12, but I do not know why there might be an error there.
line 12:
board frame = new boardLayout();