0

So i'm making a sudoku game for class. I've got a grid JPanel thats a grid of different spaces. each space on this grid is JButton that contains a Space class field and is attached to a list, and each list has a corresponding list actionlistener that changes the value of the Space depending on which selection the user makes.

Also attached to this list is an actionlistener in the original JFrame that the grid JPanel is contained within. what i'm trying to do is have this actionlistener in the JFrame use a method to see if any of the spaces on the sudoku board are unfilled, so that if they are all filled it can do an appropriate win or lose window.

but what i think is happening is that the code changing the value of the spaces in the list actionlistener hasn't executed by the time the code to look for unfilled spaces has in the JFrame actionlistner, thus resulting in a response of false from the method checking whether the game has finished.

anyone have any thoughts on how to overcome this?

Jony Thrive
  • 931
  • 1
  • 7
  • 15

0 Answers0