I have a JTable in which if I enter an invalid data in a particular cell and tab out, after showing the error message the cursor should be brought back to the error cell. I was able to do this with the following code.
isCellEditable(int row, int col){
errorRow and errorCol will have the row and col where the invalid data is present.
This will act like a lock and will never let u out of the error cell if u tab again. But I want the error message to appear everytime I tab out of the error cell.

The code to display the error message is invoked from the method setValueAt().
But the problem is when I try to tab out of the cell again, I'll not be getting the error message again.This is because the setValueAt method will be called only if the cursor is on the celleditor. But the above code will not put the cursor on the editor, instead it will be on the renderer only. So while tabbing the setValueAt will not be invoked.
I tried bringing the focus to the editor by using tblDamageDetials.editCellAt(erroRow,errorCol);
Then I am getting StackOverFlow error.
Could somebody please help me out.