Here is the code for my own question, according to @camickr's solution.
public void filterRowsResults(int x1, int x2) { List<RowFilter<ResultsModel, Integer>> filters = new ArrayList<RowFilter<ResultsModel, Integer>>(2); RowFilter<ResultsModel, Integer> filterC1 = RowFilter.numberFilter(ComparisonType.EQUAL, x1, 1); RowFilter<ResultsModel, Integer> filterC2 = RowFilter.numberFilter(ComparisonType.EQUAL, x2, 2); filters.add(filterC1); filters.add(filterC2); RowFilter<ResultsModel, Integer> filter = RowFilter.andFilter(filters); resultsTableSorter.setRowFilter(filter); }
Therefore, I can call the method as follows:
filterRowsResults(valueC1, valueC2);
source share