TextArea and TextField can install  
a TextListener that catches TextEvents. TextComponents fire TextEvents every time the text of the component changes. This is more or less 
every time the user hits a key in the component.
The java.awt.event.TextListener interface defines a single method, textValueChanged():
public abstract void textValueChanged(TextEvent te)
TextListener with a TextComponent by calling the component's addTextListener() method. For example,
TextArea password = new TextArea(24)
password.addTextListener(new PasswordChecker());
A TextListener can be removed by calling removeTextListener().
public void removeTextListener(TextListener tl)