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); }