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 Unknown number of rows to create a JTable 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 "Unknown number of rows to create a JTable" Watch "Unknown number of rows to create a JTable" New topic
Author

Unknown number of rows to create a JTable

Aj Maffei
Greenhorn

Joined: Jun 18, 2009
Posts: 2
I am currently working on a project that requires me to have a JTable with 6 collums but a variable amount of rows. I know that you can use DefaultTableModel.addRow(), but the problem is that i am using NetBeans IDE to auto generate the GUI and it will not let me use the DefaultTableModel.

The auto generated code for the table is as follows:


Keep in mind i am not an excellent programmer I am looking to learn.
Help is very much appreciated,
AJ
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2156
    
    7


According to that line of code it is using the DefaultTableModel.

You can access it in your code using:



Aj Maffei
Greenhorn

Joined: Jun 18, 2009
Posts: 2
Rob Camick wrote:


According to that line of code it is using the DefaultTableModel.

You can access it in your code using:





Simple enough... i forgot to cast it as a DefaultTableModel.
Thanks for the help!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unknown number of rows to create a JTable
 
Similar Threads
Problem Updating Content Of JTable
JTable numeric validation
Tab order in JTable
How to add rows to jTable dynamically?
jtable