I have a JTable in which a user enters data into cells. Then the "Save" button appears, which collects the table data, formats it in csv and saves it to a file.
However, if the user leaves the last cell edited in the selected state and clicks the "Save" button, the data in this cell is taken as zero, so the data for this cell is not saved in the file.
Since it’s easy for a user to forget to deselect a cell (and why does she need it?), I need a method to programmatically deselect. I tried the clearSelection () method for the table, with no effect.
Any suggestions?
Thanks in advance for your help.
John doner
source
share