How can i add more than one filter for 1 Row in JXTable?
I tried using:
int col = jxTable.getColumn("Tipo").getModelIndex();
RowFilter filter1 = RowFilters.regexFilter(0, "^N", col)
RowFilter filter2 = RowFilters.regexFilter(0, "^N", col)
jxTable.setRowFilter(filter1);
jxTable.setRowFilter(filter2);
but filter2 overwrites the filter1
the usage:
I will do 3 checks box with different letters to filter,
[ ]A [ ]B [ ]C
if you check A, just show what start with A, if you check B and A, display both...
Use the
RowFilter.andFilter()orRowFilter.orFilter()methods when you want to combine more than one filter. For your situation, it sounds like you want to use theorFiltermethodSteps:
RowFilter.andFilter()orRowFilter.orFilter()to create a single filter thatANDs orORs the filters from the list.ANDorORfilter created to the JXTable.Example: