I have a row filter but I need to load everything but a value...
Example:
col1 | col2
-----------
1 | N
2 | Y
3 | O
What I need:
col1 | col2
-----------
1 | N
3 | O
What I have:
RowFilter<TableModel, Object> firstFiler = null;
List<RowFilter<TableModel, Object>> filters = new
ArrayList<RowFilter<TableModel, Object>>();
RowFilter<TableModel, Object> compoundRowFilter = null;
try {
firstFiler = RowFilter.regexFilter("(?i)" + text, 1);
filters.add(firstFiler);
compoundRowFilter = RowFilter.andFilter(filters);
} catch (java.util.regex.PatternSyntaxException e) {
return;
}
sorter.setRowFilter(compoundRowFilter);
See the example in the JavaDoc:
https://docs.oracle.com/javase/8/docs/api/javax/swing/RowFilter.html
The following example from the JavaDoc link above shows an include method that allows only entries containing one or more values starting with the string "a":
You could modify the above example to instead include everything except "2".
I recommend reading through the summary of that JavaDoc link to get a better understanding of how it works.