• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTable deleting a row memory problem  RSS feed

 
Doua Beri
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi. I'm using in my application a Jtable with a DefaultTableModel model and I put in some cell a checkbox and JProgessBar. I'm using specific renderers for this

My question is when I delete a row it will automaticly delete all the components from every cell (free the memory) in the row or I need to do more implementation??
The rows are being deleted automatecly by the program.

Thank you
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The table is not aware of the data. It relies on your model for it.
Typically when you remove any row, it is deleted from the model and the table just reflects the updated state of the data. If you are using the addXXX and removeXXX methods in model, everything else is taken care of automatically. Check out the different fireXXX methods available. They initiate the painting to reflect any model changes.

Once you delete any data from the model, depending on the circumstances, it would be available for garbage collection, like any other standard object.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!