File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can I add rows in a Jtable

 
ben riches
Ranch Hand
Posts: 126
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
I read in a csv file then I put that file in Vector v, and the call the vector.size method and put the size of the vector into a int called num2. now I want to be able to set up the rows so that the rows are the size of the file. ie if the v.size()(num2) is 10 I want the rows in the JTable to resize to that.
Can anyone help please
Thanks
Ben
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think this thread is duplicated and I replied to your questions as much as I can in the other thread...
I'm wondering why u posted a new thread with the same topic???
By the way, u might want to try the following constructor to set the initial cells in the table...
int numberOfRows = getNumberOfRowsFromSomewhere();
int numberOfColumns = getNumberOfColumnsFromSomewhere();
JTable table = new JTable(numberOfRows, numberOfColumns);
Hope this helps a bit...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic