mKorbel
Veteran Poster
1,141 posts since Feb 2011
Reputation Points: 480
Solved Threads: 224
"Does not work" is pretty vague. Using the TableModelListener as mKorbel linked to should work just fine.
Post the code that you used for your listener.
Ezzaral
Posting Genius
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
The import part of that example code is the listener being added to the JTable
jTable2.getModel().addTableModelListener(new TableModelListener() {
public void tableChanged(TableModelEvent e) {
System.out.println(e+" cacat");
//jTable2.setValueAt("",0,0);
}
});
You need to put that in your code somewhere after you have initialized 'jTable2'. It only needs to be done once when you are setting up the table.
Ezzaral
Posting Genius
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
mKorbel
Veteran Poster
1,141 posts since Feb 2011
Reputation Points: 480
Solved Threads: 224