Jason S
Jason S

Reputation: 189626

swing: appropriate Listener for JTextField change events

Which type of Listener do I use for listening to changed text events in a JTextField? (I should know this or be able to tell from the Javadoc but I can't seem to figure it out.)

Upvotes: 10

Views: 8720

Answers (1)

JRL
JRL

Reputation: 77995

Use the underlying document:

myTextField.getDocument().addDocumentListener();

Upvotes: 20

Related Questions