title: Debugging Java Program. using Netbeans IDE 7.1
body: <p>I am using Netbeans IDE 7.1, and I was trying to debug my simple program and on the Variable Output Window, there is a message which states <strong>"No variables to display because there is not current thread."</strong> What does it mean? Thanks. :)</p>
  
  <p>Here's my code:</p>
  
  <pre><code>public class SwingExercise {
  
  public static void main(String[] args) {
  
  
      String name = "";
      String pw = "";
      boolean input = true;
      boolean hasDigit = true;
      while (input) { 
          try {
  
              while (name.equals("")) { 
  
                  name = JOptionPane.showInputDialog(null, "Enter username:");
                  if (name.equals("")) {
                      JOptionPane.showMessageDialog(null, "No input.", "Error", JOptionPane.ERROR_MESSAGE);
                      name = "";
                  }
  
                  while (hasDigit) { 
                      for (int i = 0; i &lt; name.length(); i++) { 
                          if (Character.isDigit(name.charAt(i))) {
                              throw new InputMismatchException();
                          }
                      }
                      hasDigit = false; 
                  }
              }
  
  
              while (pw.equals("")) {
                  pw = JOptionPane.showInputDialog(null, "Enter password:");
                  if (pw.equals("")) {
                      JOptionPane.showMessageDialog(null, "No input.", "Error", JOptionPane.ERROR_MESSAGE);
                      pw = "";
                  }
              }
          } catch (NullPointerException e) { 
              System.exit(0);
          } catch (InputMismatchException e) { 
              JOptionPane.showMessageDialog(null, "Invalid input.", "Error",
                      JOptionPane.INFORMATION_MESSAGE);
              name = "";
          }
      }
  }
  </code></pre>
  
  <p>}</p>