JTable setValueAt not being executed


   I am extending "AbstractTableModel" using Java 1.3.  I can double click on a cell and enter data into the JTable, but all of the entered data disappears when I double click a different cell ("change editing focus").  "setValueAt" is not executed, but "isCellEditable" is executed.  A snippet of the "AbstractTableModel" is listed below:

public boolean isCellEditable(int row, int col){ return true; }

public void setValueAt(Object aValue,int rowIndex, int colIndex) {
       data[rowIndex][colIndex] = (aValue==null?aValue:aValue.toString());;
       fireTableCellUpdated(rowIndex, colIndex);
Who is Participating?
allelopathConnect With a Mentor Commented:
Have you implemented your own CellEditor?
If so, make sure that you are calling cancelCellEditing() and stopCellEditing().

How do you know setValueAt() is not getting called.

Can you post your getValueAt() method.
>>I am extending "AbstractTableModel" using Java 1.3

You may well find that extending DefaultTableModel is much easier as the basic functionality is already implemented for you.
rmundkowskyAuthor Commented:
Found my problem,  I was overloading "editingStopped" when I extended JTable.  Thank you all for you inputs.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.