I have 2 classes for the game I am making: a gui class and the logic class, for a game of noughts and crosses. The GUI class has a method that uses an array of JButton
s and returns them all with the same anonymous inner class action listener.
When I click the button, I want the text to change to an x or a o dependant on player 1 or 2 go, but this code should be in the logic class shouldn't it so somehow I should be making a method in the logic class and calling it from the anon inner class action listener of the make button method. However, the logic class shouldn't have a reference to the gui, as the gui has a reference to the logic class.