I'm making a table in which I need to filter some data, I do this with a combobox, to filter it works well, but when I select the index 0 item (default) it does not return the table to its normal state What do I do?
I use this code.
public void itemStateChanged(ItemEvent e) {
if (e.getSource() == this.jCarreras) {
if (e.getStateChange() == ItemEvent.SELECTED) {
int index = this.jCarreras.getSelectedIndex();
String item = (String) (this.jCarreras.getSelectedItem());
if (index > 0) {
this.sorter.setRowFilter(RowFilter.regexFilter(item, 5));
}
}
}
}
How can I do so that when the index is 0, I return all the information from the original table?