Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我将一个值为“旧”的单元格更改为“新”。这将调用 tableChanged(TableModelEvent)。如何检索单元格在“新”(应该是“旧”)之前的值?
我曾想过复制我的 JTable 的 TableModel,但有没有更简单、更智能的方法来做到这一点?
提前致谢!
Try this when your table loads first time int row1=table.getRowCount(); int column=table.getColumnCount(); val=new Object[row1]; val1=new Object[row1]; for(int j=0;j<row1;j++){ val[j]=table.getValueAt(j, 0); val1[j]=table.getValueAt(j, 1); }