swing: appropriate Listener for JTextField change events

前端 未结 1 690
感动是毒
感动是毒 2021-02-20 12:14

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.

相关标签:
1条回答
  • 2021-02-20 12:44

    Use the underlying document:

    myTextField.getDocument().addDocumentListener();
    
    0 讨论(0)
提交回复
热议问题