[Bluej-discuss] JTable, get current cell content

Beat von Arx beatvonarx at compuserve.com
Thu Jul 27 22:39:07 BST 2006


Hello!  

  I am trying to update a string with the content of a JTable cell.
  For this, I listen to the KeyPressed event.
  If I read (after stopping the editor) the value in the given cell, I
   always miss the last character typed (the cell displays 12345,
   getValueAt() returns 1234). KeyEvent.getKeyCode() shows the missing
   character.

   the idea is to make a foolproof entry, so that the user can leave
   the table cell in any way he pleases (go to another cell, hit a button, hit
   Enter (this works) and I have always a copy of the current cell
   contents.
   
   Can anybody help?
-- 

Thank you!
Beat

using XPhome, BlueJ 2.0.4, J2SDK 1.4.2_06



More information about the bluej-discuss mailing list