Hello, I had a quick question for some of you experts out there.
I have an assignment where I have to set up a loop that sets it so that you cannot input a negative number
if (x < 0)
JOptionPane.showMessageDialog(null, "Cannot be negative, try again");
JOptionPane.showInputDialog("How tall are you");
When I put two negative numbers in a row, it just moves on. However, when I change the if-statement to a while-loop, the executed application never closes, even when I put in a positive number. How can I turn this into something that asks the question more than once, if I keep inputting a negative number?