且构网

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

JTable刷新不显示

更新时间:2023-12-03 13:02:52

我发现了问题.并留下答案供其他人找到... 意识到显示的JTable和我正在编辑的JTable具有不同的引用(请参见)后,我发现我正在创建JTable的两个不同的对象.一个要显示,另一个在main()中显示为ActionListener.侦听器收到事件并进行了更改,但是另一位则从未注意到发生了任何事情.

I found the problem. And leaving the answer here to be found by others... After realizing that the displayed JTable and the one that I was editing hold different references (see ) I found out that I was creating two different Objects of the JTable. One to be displayed and the other one in main() to become an ActionListener. The Listener received the Events and did the changes but the other one never noticed that anything was happening.