The problem seems to be you never remove the filter added to the row sorter when the check box is selected. This way the filter will be working regardless the check box status. You should be doing something like this:
cEntertainment.addItemListener(new ItemListener(){
public void itemStateChanged(ItemEvent e){
int state = e.getStateChange();
if (state == ItemEvent.SELECTED) {
...
newFilter(cEntertainment.getText());
} else {
...
removeFilter();
}
}
});
...
private void newFilter(String type) {
RowFilter<DefaultTableModel,Object> rf = null;
try{
rf = RowFilter.regexFilter(type);
}catch(java.util.regex.PatternSyntaxException e){
return;
}
sorter.setRowFilter(rf);
}
private void removeFilter() {
sorter.setRowFilter(null);
}
As per DefaultRowSorter.setRowFilter(RowFilter filter) javadoc (remarks are mine):
Sets the filter that determines which rows, if any, should be hidden from the view. The filter is applied before sorting. A value of
null
indicates all values from the model should be included.