dcsimg

How can I determine if the user has switched cells in a JTable?

Scott Stanchfield

You can listen for

  • Changes in selection in the table. When the user switches cells, the selection changes (you would need to be sure your cell editor actually does change selection if you're using a custom editor)
  • Changes in focus to the table

These should allow you to watch properly.