hey guys, i got a problem with my application. in my JTable, when I enter a value in a cell, and later press a button to update it, the value won't be properly input-ted into the corresponding cell unless I press the ENTER key after i finish typing the value! so now i have to *remember* to press ENTER everytime i want to update anything in the table because if i don't, the value enter just before the "update" button is pressed won't be inside. how do i deal with this problem? do i unfocus the table when the button is pressed, or what? how did u guys deal with this problem?
In your button's actionperformed code , add the following code as first line: table.getCellEditor().stopCellEditing(); what this does is makes the table's default cell editor to stop editing & stores the value, now you can call tablemodel.getDataVector() ..etc. & get the required value. This should solve your problem ,Chin.
- Vinod<br />-------<br />SCJP2
posted 18 years ago
CAUTION! Do not touch the blades on your neck propeller while they are active. Tiny ad: