File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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>
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: dynamic swing tables ??????????
 
Similar Threads
How to pass Arraylist values from an actionClass to a JSP page
How to insert form-data(.jsp) into MySql through Servlets
WA #1.....word association
what is K&B book-SCJP exam
Clean database