• Post Reply Bookmark Topic Watch Topic
  • New Topic

Clear JTable at once

 
Ransika deSilva
Ranch Hand
Posts: 524
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
Could you please tell me how to clear all the values in a JTable at once. Is there a method for this? Or do I have to create my own method?
Thanks in advanced....
 
Garandi Garandi
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Set your table model to be null.
Garandi
 
Ransika deSilva
Ranch Hand
Posts: 524
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you please be more specific. The coding I mean.
Thanks
 
VIJAY Yadlapati
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming your tableModel is DefaultTableModel,
call setDataVector(null, columnHeaders) on TableModel
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!