且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

JTable:检测单元格数据更改

更新时间:2023-12-03 11:52:16


但是它还没有使我能够检测到这个单元格的旧值和新值。我还需要做什么?

But it doesn't yet enable me to detect the old and the new value of this cell. What else do I have to do?

使用TableModelListener监听更改更容易,但仍然有问题可以访问旧的值。

It is easier to use a TableModelListener to listen for changes but it still has the problem of not being able to access the old value.

查看表格单元格侦听器,为您提供访问旧值以及新值的解决方案。

Check out the Table Cell Listener for a solution that gives you access to the "old value" as well as the "new value".