I was working in java and I am practicing my GUI.
I was doing a little guessing game in which the user inputs a number until he guesses right. Comments such as "Too low" or "Too high..Guess again." are also included between his guesses.
At the end, he is prompted if he wants to play again, a score is calculated and so on..
I have also created a listener so when the user inputs a number in the texfield, and presses the "Guess" button the number is saved into a variable.
The thing is my program will just get to the end without waiting for an input, witthout waiting for the listener. What can I do to tell the program to wait each time for the listener to be hit before it continues its operations??
I was doing a little guessing game in which the user inputs a number until he guesses right. Comments such as "Too low" or "Too high..Guess again." are also included between his guesses.
At the end, he is prompted if he wants to play again, a score is calculated and so on..
I have also created a listener so when the user inputs a number in the texfield, and presses the "Guess" button the number is saved into a variable.
The thing is my program will just get to the end without waiting for an input, witthout waiting for the listener. What can I do to tell the program to wait each time for the listener to be hit before it continues its operations??