Maybe would be that deleteLine()
is a method that belongs to simpleTableModel
, but you aren't creating any instance of that simpleTableModel
on the frame. You are doing directly
lista.setModel(new SimpleTableModel(dados, colunas));
Try doing in your frame:
SimpleTableModel modelo = new SimpleTableModel(dados, colunas);
lista.setModel(modelo);
modelo.deleteX(line);
And inside your model something like this:
public boolean deleteX(int line) throws DAOExcepcion{ //could be void because always returns true
this.removeRow(line);
this.fireTableRowsDeleted(line, line);
return true;
}