I have a JButton, and when a player clicks on it, it tells my event listener that the button is pressed. I want to know that there is a team or something that acts if the player clicked a button.
Like Tic Tac Toe, I have 2 players that can play against each other, but I want to add an option for the computer player and the player. But since the computer cannot actually press the button, I am lost.
Edit: it would be as simple as gridButton2.click()
(Button name) .click ();
Joe c source share