Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

dynamic swing tables ??????????

 
gagan sharma
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all !
will someone tell me that Is it possible to make a Jtable using SWINGS dynamically by picking the table from the database at the standalone terminal ,thereby creating as many rows and columns as r in the table.
hope to get a quick response
gagan!
------------------
 
Laojar Chuger
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes.
How to do it? Read JTable API.
 
eric moon
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, there is a constructor for JTable that takes a 2d array. Read your data into an array, and create the Table using it as an argument. It will have the correct number of rows and columns. You can also use a vector of vectors as a tableModel. If you change the number of rows or columns dynamically, make sure to call fireTableStructureChanged()
HTH
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic