title: Value Change Listener to JTextField
body: <p>I want the message box to appear immediately after the user changes the value in the textfield. Currently, I need to hit the enter key to get the message box to pop out. Is there anything wrong with my code?</p>
  
  <pre><code>textField.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent e) {
  
          if (Integer.parseInt(textField.getText())&lt;=0){
              JOptionPane.showMessageDialog(null,
                      "Error: Please enter number bigger than 0", "Error Message",
                      JOptionPane.ERROR_MESSAGE);
          }       
      }
  }
  </code></pre>
  
  <p>Any help would be appreciated!</p>