title: Text Changed event in JTextArea? How to?
body: <p>I have been trying to make a text changed event handling mechanism for my <code>JTextArea</code>. For my purposes an event has to be fired whenever there is a change in the text of the <code>JTextArea</code>. I tried using the <code>KeyListener</code> interface and here is my code for that.</p>
  
  <pre><code>txtArea.addKeyListener(new KeyListener() {
  
      @Override
      public void keyTyped(KeyEvent arg0) {
  
      }
  
      @Override
      public void keyReleased(KeyEvent arg0) {
          // TODO Auto-generated method stub
  
      }
  
      @Override
      public void keyPressed(KeyEvent arg0) {
          currentText = text.getText();
          if (currentText == textString)
              JOptionPane.showMessageDialog(null, "Correct");
  
      }
  });
  </code></pre>
  
  <p>Nothing happened when the textarea's text matched the hardcoded text. How can an event changed event be made for this.<br>
  Can this objective be achieved with a <code>PropertyChangedListener</code>? If it can, then how?</p>