Question

There are many rows on above showing jtable. I want to filter record by short code. If I type short code like 1234 it should be display only short code 1234 associated row on jtable.

Thanks

Was it helpful?

Solution

You're going to have write the code...Start by checking out how to use tables, in particular sorting and filtering

The basic requirement would be to attach an ActionListener to both the field and button (you can do this from the form editor if you wish).

Within the actionPerformed event handler method, you need to create a RowFilter and apply it to the tables RowSorter.

A table can be configured to automatically create a row sorter by setting the autoCreateRowSorter property to true.

It's all explained nicely in the linked tutorials...

And another example

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top