java - How do I Click a JButton without the user Clicking it? -


i have jbutton , when player clicks it tell action listener button clicked. want know is there command or acts if player clicked button.

like tic tac toe, have 2 players can play against each other, want add option computer player vs human player. since computer cant click button, lost.

edit: easy gridbutton2.click() (name of button).click();

pretty much. need use doclick() function. see the api more information.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -