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

From change in JTable to write to database  RSS feed

Daan Heuvelbeuk
Ranch Hand
Posts: 85
MySQL Database Netscape Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been searching, but have not found the answer. Is it a nifty feature of the DefaultTableModel?

What do you need to do to write a change (delete row, delete all rows, insert new row, change field value) to the database, AND update your JTable?

In my application I read time written on a project's activity from a database, create Project objects. For my application I get all records (Projects) between a Monday, and it's subsequent Sunday (week starts with Monday). I convert these Projects to my JTable using:

I add one method I now have finished. It finds the Project object that was selected by the user, removes the accompanying row from the database, and then removes the row from the JTable.

Is this the way to work, or am I not seeing that nifty feature from the DefaultTableModel that does all this work for me?
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!