title: Is there a way for one method to resolve itself before moving on to the next item in code
body: <p>I have searched this site, oracle, and others to no avail.</p>
  
  <p>I am having a couple of issues with my program, but for right now I only want to deal with one.</p>
  
  <p>First let me post the parts of my program I am having issues with</p>
  
  <p><strong>verifyAge method</strong></p>
  
  <pre><code> private void verifyAge()
   {
       String ca = iP.cAge.getText();
       try
       {
           a = Integer.parseInt(ca); 
           if (a &lt; 0 || a &gt; 120)
           {
               JOptionPane.showMessageDialog(null,"Enter number between 0"
                       + " and 120", "Input Error",JOptionPane.ERROR_MESSAGE);
               iP.cAge.setText("");  
           }
       }
       catch(NumberFormatException afe)
       {
           JOptionPane.showMessageDialog(null, "Must Enter Number", "Input"
                   + " Error", JOptionPane.ERROR_MESSAGE);
           iP.cAge.setText("");
       }
  } 
  </code></pre>
  
  <p>I have a FileListener that this code will be going into. It needs to run and loop until error is fixed before moving on in the code. Does anyone have any suggestions and please give examples.</p>