• Post Reply Bookmark Topic Watch Topic
  • New Topic

Changing Data in JTable Cell  RSS feed

henri henri
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This method works perfectly to capture the selection made in a JComboBox and transmit the value to a JavaBean.

I would like to be able to capture the text in a cell after the enter key has been pressed. I tried to use the TableModelListener with tableChanged method to no avail and I kept getting an ArrayIndexOutOfBoundsException every time the rows in the table were refreshed by the user selecting another alphbetical category.

I am wondering if anyone with experience in JTable implementation could share some advice on how to capture the changed text in a cell. Should I use a key listener and get the cell coordinates? I tried using KeyListeners and they worked well to be able print out the text in the cell that was tested.


With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!