I have a JTextField.
I want to invoke a function when the text in it is changed.
How do I do that?
The appropriate listener in Java's swing to track changes in the text content of a JTextField is a DocumentListener, that you have to add to the document of the JTextField:
myTextField.getDocument().addDocumentListener(new DocumentListener() {
// implement the methods
});