First, let me point out that it wasn't polite to start a new
thread for this instead of continuing the
old one.
Second, I would have to agree that calling
setValueAt() from within
isCellEditable() is almost surely a bad idea.
Originally posted by meera rao:
I have a JTable with n rows and I am trying to set a value to one of the column ( say column 3 ) and disable that column so that the user cannot change it.
Having
isCellEditable() return
false will make it so the user cannot change it.
As for "set a value to one of the column" there are many ways to do this. One is to call
setValueAt(), but only once for each row. Better, I think, would be to use a custom cell renderer for that column. Your renderer would be free to ignore the actual value stored in the table model and draw anything it wants.