This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Dynamic JTable 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 JTable" Watch "Dynamic JTable" New topic

Dynamic JTable


Joined: May 21, 2001
Posts: 5
Hello Friends
I want to dynamically generate Jtable so that I will be able to display the data as per the resultset rows i.e I can have the same number of rows within the JTable as much records I have received from the resultset.
Please provide me the solution as early as possible.
If possible please provide me with the code.
Waiting for reply.
Ranch Hand

Joined: Jul 06, 2001
Posts: 257
This is a very easy problem. Use JTable in conjunction with DefaultTableModel, or create your own model by sub-classing DefaultTableModel. Update your table through the model. I wont give you the full solution because you'll learn much more if you go into the docs and figure it out yourself.
Dont ask people to solve problems for you. It's obvious that you have'nt even bothered to look at the documentation, otherwise you would have a idea of what you have to do.

I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Dynamic JTable
jQuery in Action, 3rd edition