JTable data entry

Hi,

I've just created my first JTable (inside a JScrollpane, inside a JPanel, inside a JFrame). It seems to work ok, except that when I type data into cells, the data in the last cell I edit isn't saved to the model when I "leave" the table unless I hit return after typing it in or click somewhere else in the table before "leaving."And occasionally, I forget to do that. (After all, the table *looks* right after I'm done typing.)

When I do leave the table, it's usually to press a JButton that calls a method that does a few calculations and inserts a new blank row into the model at row index 1. Ideally, I'd like that when I hit that JButton, it forces the JTable to update the model with the data typed and pending in the last cell I edited, even if I have forgotten to hit return or click someplace else first.

Is there a way to force that pending data to be saved?

Jim

[913 byte] By [JamesRomanoa] at [2007-11-27 3:39:45]
# 1
Bump for the late risers.
JamesRomanoa at 2007-7-12 8:43:07 > top of Java-index,Java Essentials,New To Java...
# 2
This sounds like a good question for the Swing forum: http://forum.java.sun.com/forum.jspa?forumID=57(They may be late risers, though :-)
DrLaszloJamfa at 2007-7-12 8:43:07 > top of Java-index,Java Essentials,New To Java...
# 3
Ok. I will post again over there.Thank you.
JamesRomanoa at 2007-7-12 8:43:07 > top of Java-index,Java Essentials,New To Java...