How do i add wait for jButton1 to be click to continue?
I have this code:
while (gameStatus == Status.CONTINUE){
////here add wait for jButton1 click
sumOfDice = rollDice(); // roll dice again
}
i have done this but its not working:
while (gameStatus == Status.CONTINUE) {
jButton1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e, int sumOfDice) {
sumOfDice = rollDice();
}
});