Ho provato questo:Come rimuovi le righe selezionate da una tabella J?
public void removeSelectedFromTable(JTable from)
{
int[] rows = from.getSelectedRows();
TableModel tm= from.getModel();
while(rows.length>0)
{
((DefaultTableModel)tm).removeRow(from.convertRowIndexToModel(rows[0]));
rows = from.getSelectedRows();
}
from.clearSelection();
}
Ma, a volte lascia un ancora lì. Quale può essere il problema?
Questo non ha funzionato per me –