This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Journey To Enterprise Agility and have Daryl Kulak & Hong Li on-line!
See this thread for details.
Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Jtable problem - last info ignored  RSS feed

 
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
 
Bartender
Posts: 9509
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!