Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create new JTable with a button click?

Tags:

java

swing

jtable

I'd like to ask how to make new JTables when button clicked (actionPerformed)? I'd like to add several JTables in that way .

like image 987
ZZ 5 Avatar asked Jan 16 '23 15:01

ZZ 5


1 Answers

  • use DefaultTableModel for JTable

  • then there no reason to recreate or remove then add JComponents

  • all updates for JTable and its Model must be done on Event Dispatch Thread

like image 93
mKorbel Avatar answered Jan 24 '23 12:01

mKorbel