I've made a board for a sudoku game but this one thing has got me stumped. It's late where i'm at and i've been working for a while and i cant find my problem. Would be nice if someone could point it out, thanks!
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JPanel;
public class SudokuPanel extends JFrame {
public final int SQUARE_COUNT = 9;
public Squares [] squares = new Squares[SQUARE_COUNT];
public SudokuPanel(){
super("Sudoku");
setSize(600,600);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLayout(new GridLayout(1,1));
setVisible(true);
setLocationRelativeTo(null);
JPanel panel = new JPanel(new GridLayout(3,3));
for(int i=0; i<SQUARE_COUNT; i++){
squares[i] = new Squares();
panel.add(squares[i]);
}
add(panel);
JMenuBar menuBar = new JMenuBar();
setJMenuBar(menuBar);
JMenu reset = new JMenu();
menuBar.add(reset);
JMenu help = new JMenu();
menuBar.add(help);
JMenu newPuzzle = new JMenu();
menuBar.add(newPuzzle);
JMenu exit = new JMenu();
menuBar.add(exit);
class exitaction implements ActionListener{
public void actionPerformed (ActionEvent e){
System.exit(0);
}
}
exit.addActionListener(new exitaction());
}
}