I have a Jtable in my Single Frame Work Appln. I have editable and uneditable fields in that. Whenever the user changes data in an editable cell, and tries to move away from that panel before saving, We prompt the user to save the changes or not.
The problem is, when the user had double clicked on the editable cell, but did not change/ key in any data..
Stil the trigger for Save changes gets called..
How can i do a KeyListener here? Or any other way to identify if the current cell data has changed or not??
That's because the data is not committed yet. If the user presses escape the changes are ignored. Only when you commit (usually by pressing enter) this method is called, and the model really contains that data. You can use the following code to commit all changes when your table looses focus: