What is the best way to listen for changes in JTable cell values and update database accordingly?

前端 未结 4 1639
攒了一身酷
攒了一身酷 2020-12-17 21:59

I\'m building and app with multiple JTables and I need to detect when cell value change occurs so I can update it in the database. I tried TableModelListe

4条回答
  •  忘掉有多难
    2020-12-17 22:21

    This is also handy if you want to stop the editing on an event handler from selection change or save button.

    if (table.isEditing())
        table.getCellEditor().stopCellEditing();
    

提交回复
热议问题