Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JTable editing - how to be informed when a cell STARTS editing?

843806Dec 11 2008 — edited Dec 12 2008
I have a JTable with editable cells (containing Strings). I want to be informed when an editing operation begins (either by user gesture, or programmatically by the "JTable.editCellAt(row, column)" method). I want to record the initial value in that cell, so I can respond appropriately if the value changes after editing has stopped.

I note the existence of the CellEditorListener interface; however, it only has callback functions for "editingStopped" and "editingCanceled". I need a comparable "editingStarted".

I cannot simply use a ListSelectionListener to listen for new selection events, because the existence of the "editCellAt" method makes it possible to start editing a cell without explicitly changing its selection state.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 9 2009
Added on Dec 11 2008
11 comments
1,012 views