addChangeListener
public static void addChangeListener(javax.swing.text.JTextComponent text,
javax.swing.event.ChangeListener changeListener)
Installs a listener to receive notification when the text of any
JTextComponent
is changed. Internally, it installs a
DocumentListener
on the text component's Document
, and a
PropertyChangeListener
on the text component to detect if the
Document
itself is replaced.
- Parameters:
text
- any text component, such as a JTextField
or
JTextArea
changeListener
- a listener to receive ChangeEvent
s when the text is
changed; the source object for the events will be the text
component
- Throws:
java.lang.NullPointerException
- if either parameter is null
- See Also:
jtextfield