Your fragment shows incorrect synchronization. In particular, you access BeanTableModel
, a subclass of AbstractTableModel
, from the background thread. Instead, pass the List<Integer> rowsToRemove
to your worker in its constructor.
Addendum: Instead of invokeLater()
, you can update the TableModel
in your implementation of process()
, which executes on the EDT. Also, you shouldn't have to fireTableDataChanged()
, which "Notifies all listeners that all cell values in the table's rows may have changed." The removeObject()
implementation should fire the least pervasive event required to effect the change.