What I'm trying to achieve is a JTextField
with a JTable
on the bottom, every time a change occurs on the JTextField
(type or delete a character) the JTable
would update showing the results from it's list of strings that match what is written on the JTextField
, and showing all results if empty.
What I don't know how to do :
- How to set the event on the JTextField that triggers everytime its text changes
- Making the JTable update its values in an efficient way, without using too much memory
Add a
DocumentListener
to yourJTextField
. Update theTableModel
belonging to yourJTable
with matches. TheJTable
will update itself in response.