JTable editor doesn't stop the first time

From: Carlo Bamberg (carlo.bamberg_at_pch.etat.lu)
Date: 10/16/03


Date: 16 Oct 2003 00:17:55 -0700

I wrote the following lines to have the celleditor in a JTable stop

DefaultCellEditor editor =(DefaultCellEditor)table.getCellEditor();
   if (editor != null) {
      editor.stopCellEditing();
      if (table.isEditing())
         editor.cancelCellEditing();
   }

This shall make sure that the editing of the current cell stops before
I create my select statement or update statement for the database. I
works fine, except for the first time. (I modify a date in the table
and save it, no modification on the database. I modify the date a
second time and save it, now it works. And from now on it works as
long as I don't quit the application.)

Any ideas why?

- Carlo Bamberg


Quantcast