title: while loop not repeating after setting to false
body: <pre><code>  boolean gotGoodGenInput = false;
    while (!gotGoodGenInput)
    {
  
      gotGoodGenInput = true;
  
      String inputGen = JOptionPane.showInputDialog
      (
        "Enter your Generation \n" +
        "It must be a number from 0 to 25"
      ); 
  
      if(inputGen != null)
      {  
  
        if (inputGen.isEmpty() || !inputGen.matches("[0-9]*")) 
        {
          JOptionPane.showMessageDialog
          (
            null,
            "Please input a number from 0 to 25",
            "Error",
            JOptionPane.ERROR_MESSAGE
          );
          gotGoodGenInput = false;
        }
  
        int GenNumber = Integer.parseInt(inputGen);
  
        if (GenNumber &lt; 0 || GenNumber &gt; 25)
        {
          JOptionPane.showMessageDialog
          (
            null,
            "Your number can't be less than 0 or greater than 25",
            "Error",
            JOptionPane.ERROR_MESSAGE
          );
          gotGoodGenInput = false;
        }
  
      }
      else
      {
        System.exit(0);
      }
    }
  </code></pre>
  
  <p>Hello the issue I am having is that if a user enters "a" (as an example) then they will get the error "please input a number from 0 to 25" from </p>
  
  <pre><code> if (inputGen.isEmpty() || !inputGen.matches("[0-9]*"))
  </code></pre>
  
  <p>and it's supposed to restart the loop when it hits gotGoodGenInput = false;</p>
  
  <p>but it keeps going to the next part where it will try to parse the int but of course it will error since "a" is not an int</p>
  
  <p>so my issue is why is it not starting over when it reaches gotGoodGenInput = false; in the first if statement.</p>