This function is called whenever the user changes the cell value.
Warning: If you call setValueAt() within cellValueChanged, it will create infinite loop because cellValueCHanged itself is called within setValueAt().
setValueAt()
{
cellValueChanged();
}
There are two solutions
1) If you are trying to setvalue to the same cell which is changed, just return the new value from the cellValueCHanged method.
2) If you are trying to update a different cell,just save the change in a variable and then when user moves to a different cell, call setValueAt for the changes you like to do.
- Parameters:
row
- the row of the cell in which the cell data is changed by the usercol
- the column of the cell in which the cell data is changed by the user.
column starts from 1,2,3...
Even if the user moves the column, you are guaranteed to get original column. if you use moveColumn(), it will return current column only.oldValue
- the old data in the cellnewValue
- the new data which the user wants to change
- Returns:
- the actual value you want to be changed in this column
if you dont want to change the column return null