posted 23 years ago
I came across the same problem and struggled with it for a couple of days, but finally got it figured out.
You need to implement isCellEditable(row,col) in your data model to return the appropriate boolean flag for the cells. Then add a key listener to the table and implement the keyReleased method to check for VK_TAB key code, if it is the tab key, then loop through your table, checking to see if the cell is editable. If editable, call changeSelection method to change to the next editable cell.
The logic is actually a bit more involved than this, but this should get you started. The other thing I would do is add a focus listener to clear selection on focus lost and change selection to the first editable cell on focus gained. Also, if you are planning to tab out of the table using the tab key as opposed to CTRL TAB, then you need to use the focus manager when you are tabbing out of the last editable cell.
Good luck!
Sayuri