I have used Swing Bits Table Filtering for this:
I want to obtain auto filtering in JTable as in ms excel
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
Solution 2
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.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow