私の UI では、TableModel で JTable を使用しています。実装された Observer インターフェイスの update メソッドで、repaint メソッドを呼び出しています。タブを介して(再描画の代わりに別のメソッドを呼び出します)
これは update メソッドのコードです。
public void update(Observable o, Object arg) {
((MyTableModel)table_.getModel()).addTableRow(row);
//addTable(row) adds the row to the dataVector that populates the JTable
//the dataVector is updated with added row
table_.repaint();
}
JTable が更新されない理由を知りたかったのですが、注意してください -> データ ベクトルには、追加された行を含む必要な行があります。