I'm having trouble getting this while loop to stop and look for a new input. Obviously the while loop is infinite because I don't get new input. I know this is easy but I'm still stuck
here is my while loop
while (guessInt != randInt){
setPrevGuess(guessInt);
guessInt = Integer.parseInt(GuessGame.numberField.getText());
if (guessInt != randInt){
if (guessInt > prevGuess ){
guessGame.setBlueBackground();
setMessage(new JTextField("You're getting colder"));
}
if (guessInt < prevGuess ){
guessGame.setRedBackground();
setMessage(new JTextField("You're getting warmer"));
}
}
}
and I need to grap new information from a JButton in a different class
JButton guessButton = new JButton("Guess");
GuessHandler guessHandler = new GuessHandler();
guessHandler.setGuessGame(this);
guessButton.addActionListener(guessHandler);
guessFrameContainer.add(guessButton);
Can anyone please help this idiot?