Paul Clapham wrote:You appear to know that it's the table model which will have to do this work, but still you didn't post the code for the table model.
Anyway. You would have to override the addRow() and insertRow() methods to handle inserts to the table, and you would have to override the setValueAt() method to handle updates to existing rows. And removeRow() to handle deletes.
Paul Clapham wrote:You appear to know that it's the table model which will have to do this work, but still you didn't post the code for the table model.
Anyway. You would have to override the addRow() and insertRow() methods to handle inserts to the table, and you would have to override the setValueAt() method to handle updates to existing rows. And removeRow() to handle deletes.
Paul Clapham wrote:Ah, I see. So in fact you haven't written a table model class. Then you will have to do that, I suppose. Or perhaps you could attach a TableModelListener to the table model and update the database based on the TableModelEvents you receive from it.
Although I am completely unfamiliar with Netbeans -- for all I know it might have a database-backed JTable as one of its choices.
Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |