I am making a student record application... I want a column in it which is editable. I have attached table model listener on table and on that column i m saving all the updating values
if(table.getSelectedColumn() == 3 && table.getSelectedRow() != -1 && tme.getType() == TableModelEvent.UPDATE)
{
// my code here
table.cellEditAt(row,column); // this is giving me error
}
table.cellEditAt
automatically calls table model event and that is producing a infinite loop... Any other method to automatically select a cell for editing????
The answer was to post an SSCCE. We are not mind readers. We can't guess what your editCellAt(...) method does. If it causes a loop, then that would be because you are somehow changing the model and generating another TableModelEvent. Don't do this!
If the problem is somehow related to placing a cell in edit mode, then I would guess you need to wrap that code in a SwingUtilities.invokeLater() to make sure the processing of the original event is completed before you place another cell in edit mode.