I have a jTable in netbeans that is abstract and contains several columns like code, name, location, gravity, etc. I already have the code for this part, but I want to sort only a few columns such as name and severity. I do not know if anyone can help me, I will leave below the part of code I have to order the table.
public void sort() {
TableRowSorter<DefaultTableModel> sorter = new TableRowSorter<DefaultTableModel>(modeloTabela);
tabelaDoentes.setRowSorter(sorter);
sort();
}