File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

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

gagan sharma

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
Laojar Chuger
Ranch Hand

Joined: Dec 20, 2000
Posts: 111
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()

<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>
I agree. Here's the link:
subject: dynamic swing tables ??????????
It's not a secret anymore!