Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Populating data into JTable  RSS feed

Sri Rangan
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. From Database, I get a collection of DataObjects (Each Data Object will represent a row in the Database table). I, now, loop thru the collection to create the Vector of rows and setting it to my Model class which is derived from DefaultTableModel.
2.When ever I update the database, I get the row selected and the data Vector and unwrap the data vector to creat the dataobject. This steps seems to be extra work. IS there any better way to populate the data?
3.After populating the values into JTable, I need to keep track of the values(at cell level), user changes/selecting. My table cells have JCheckBox or JComboBox. I can think of having a dirty flag for every cell. But I am not able to think how to implement it. Any help with sample code will be appreciated.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!