• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTable edited rows  RSS feed

 
Matt Jacks
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to determine how to keep track of rows that have been edited by the user in a JTable. I would like to put the row that has been edited into an array to then build sql update statements. I am not sure how to determine when editing has occurred in general as I have multiple cell editors. Any help is appreciated
 
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Create your own data model and override the setValueAt() method. It takes row as 1 of the parameters. It gets executed when the user exits edit mode in a table cell. Keep track of the rows that are flagged from this method. Look at the API for DefaultTableModel.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!