public void applyRowFilter(JTable table, String str, int selectedIndex) {
        DefaultTableModel model = (DefaultTableModel) table.getModel();

        TableRowSorter<TableModel> sorter = new TableRowSorter<TableModel>(model);
        table.setRowSorter(sorter);

        ArrayList<RowFilter<Object, Object>> andFilters = new ArrayList<RowFilter<Object, Object>>();

        andFilters.add(RowFilter.regexFilter(str, selectedIndex));
        andFilters.add(RowFilter.notFilter(RowFilter.regexFilter("Afsluttet", 4)));


        sorter.setRowFilter(RowFilter.andFilter(andFilters));
    }