• Post Reply Bookmark Topic Watch Topic
  • New Topic

Jtable problem - last info ignored  RSS feed

 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jtable problem:

I have a JTable with 3 columns: name, age, email.
I retrieve all the info into a vector and then update my db. the problem is that the last info from the table is never updated (doesn't even get to the vector).

example: say I place this info:

Jame 33 james@hotmail.com (and press the update button)

the last info was (james@hotmail.com) this doesn't get to the vector!

*** In order to correct it I realize I have to press on a different 'box' in the jtable

how can I avoid it?

Ppr
 
Joe Ess
Bartender
Posts: 9439
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yea, the information you enter on a cell editor doesn't get back to the table model until you "unselect" the cell editor by clicking on another cell. When you process the "update" button click, check to see if there is a cell still being edited (JTable.getEditingColumn() and JTable.getEditingRow()) and move the new data into the model yourself.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!