Link to home
Start Free TrialLog in
Avatar of amp834
amp834

asked on

Java JTable clicking out of a field that is being edited does not update field values

I display a JTable with editable text columns, when the user double-clicks on a column to edit a field, then clicks on another column, the field that was edited gets updated.  But if the user double-clicks on a column to edit the field, makes changes, then presses a JButton somewhere on the same form, the table value is not updated automatically.  (The JButton code uses the values in the table, and is not getting the latest value from that last field that was being edited.)

Is there a way to make JTable automatically update a field that's being edited when the focus changes to something else?  Or at least is there some call I can put in the JButton's code to say "Finish/update and edits that were being done on the JTable"?

ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of amp834
amp834

ASKER

Thanks for the help, I used object's suggestion (the link was clearer, for me anyway), and also gave credit for ksivananth for helping as well.