2
我有一個從後臺運行線程填充的TableModel。我在插入數據時調用fireTableRowsInserted,這不在EDT上。Java Swing TableModel fireTableRows插入EDT
我的問題是,我需要爲fireTableRowsInserted使用invokeLater嗎?
換句話說,是正確如下:
public void putData(TableRow row) {
// we are not on the EDT here...
rows.add(row);
fireTableRowsInserted(rows.size()-1, rows.size()-1);
}