Question

I am using jtable to display data from ms sql server table.
I am able to sort the data using:

TableRowSorter<TableModel> sorter = new TableRowSorter<TableModel>(model);    

jtable.setRowSorter(sorter);

The above sorts the data in ascending and descending order.

Is there any such simple function in java to obtain auto filtering of rows as in ms excel?

Thanks in advance

Was it helpful?

Solution 2

I have used Swing Bits Table Filtering for this: enter image description here

OTHER TIPS

You may also want to have a look at Coderazzi's TableFilter. It has a permissive MIT license, is available from Central Maven, etc.

Unlike the Swing Bits Table Filtering (referenced in another answer on this page), the Coderazzi TableFilter doesn't mess with the table header. I guess it is a matter of taste.

TableFilter Example

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