title: Java Catch Exception - Empty String
body: <p>I'm looking for an exception on how to catch an invalid String that is user input. I have the following code for a exception on an integer input:</p>
  
  <pre><code>            try {
              price = Integer.parseInt(priceField.getText());
              }
              catch (NumberFormatException exception) { 
              System.out.println("price error");
              priceField.setText("");
              break;
  </code></pre>
  
  <p>But I'm not aware of a specific exception for strings, the input is a simple JTextBox so the only incorrect input I can think of is if the user enters nothing into the box, which is what I'm looking to catch. </p>