GeeCON Prague 2014*
The moose likes Swing / AWT / SWT and the fly likes dynamic swing tables ?????????? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "dynamic swing tables ??????????" Watch "dynamic swing tables ??????????" New topic
Author

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

gagan sharma
Greenhorn

Joined: Oct 05, 2000
Posts: 21
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

Joined: Dec 20, 2000
Posts: 111
Yes.
How to do it? Read JTable API.
eric moon
Ranch Hand

Joined: Nov 26, 2000
Posts: 133
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


<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>"Those who cast the votes decide nothing. Those who count the<BR>votes decide<BR>everything." <BR> -Joseph Stalin<HR></BLOCKQUOTE>
 
GeeCON Prague 2014
 
subject: dynamic swing tables ??????????