How to use TextChanged event?

5.6k views Asked by At

I have a text box in which the user enters a unique number. After he enters a number and press tab or enter. I want to write query to search record matching to that unique number. The number is an integer. It will be passport no, pan card no or etc. If it is available in database, I want to display all information of that user.

I don't want to do that on button click.

I was looking for some TextChanged event but I found that the alternative in Java is the methods in document listener. But I am not getting how to use that. Also in Netbeans in the design view it does not show me any event on text changed. How to use Documentlistener to my JFrame/how to fix this?

1

There are 1 answers

0
Hakan Serce On

Here you can find a tutorial on DocumentListeners and example code as well.