Here you can find the source of filt(ArrayList
public static void filt(ArrayList<Integer> selectedLevel, String text, TableRowSorter<TableModel> sorter)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import javax.swing.RowFilter; import javax.swing.table.TableModel; import javax.swing.table.TableRowSorter; public class Main { public static void filt(ArrayList<Integer> selectedLevel, String text, TableRowSorter<TableModel> sorter) { ArrayList<RowFilter<Object, Object>> filters = new ArrayList<RowFilter<Object, Object>>(2); RowFilter<Object, Object> textFilter = null; RowFilter<Object, Object> levelFilter = null; if (text.length() != 0) { textFilter = RowFilter.regexFilter(text); }/*from w w w . ja va 2 s . c om*/ if (!selectedLevel.isEmpty()) { String levels = "["; for (Integer integer : selectedLevel) { levels += ((integer + 1) + ""); } levels += "]"; levelFilter = RowFilter.regexFilter(levels, 1); } if (levelFilter != null) { filters.add(levelFilter); } if (textFilter != null) { filters.add(textFilter); } sorter.setRowFilter(RowFilter.andFilter(filters)); } }