With tables that can be edited by users, most applications provide a “Save” button. If the user is editing a cell when he presses the “Save” button, the content of the TableModel does not match the content on the screen (currently edited cell is not saved to the Table Model yet). Always remember to de-activate the editor before actually processing the Table Model.
table.getDefaultEditor(Object.class).stopCellEditing();
Maybe a better approach is to use the following code. One reason, it’s a lot more general - what if the current editor isn’t for the Object class.
if (table.isEditing()) table.removeEditor();