TicTacToe with GUI in Java

You only need to import import javax.swing.*; for the TicTacToe.java. Edit the win if statements and delete the static definitions: Add TicTacToe ticTacToe = new TicTacToe(); to the Gui variables. Change the action listener: Delete TicTacToe ticTacToe = new TicTacToe(); from the Control. Always check your errors, you had more NullPointerException exception than you can count.