aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes adding rows in 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 "adding rows in jTable" Watch "adding rows in jTable" New topic
Author

adding rows in jTable

Anirudh Gaur
Greenhorn

Joined: May 11, 2011
Posts: 5
How to add rows dynamically in a jtable? I did not find any specific method for adding rows.
I want to write a code which should take the data(from textfield,list etc) and add it to a jtable by creating a new row each time(or as per requirement) in the jtable.
Help plzz.....
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4542
    
    5

Anirudh Gaur wrote:How to add rows dynamically in a jtable?

That all depends on what exactly you mean by dynamically.

Anirudh Gaur wrote:I did not find any specific method for adding rows.

Have you looked at the methods of DefaultTableModel?

Anirudh Gaur wrote:Help plzz.....

Please Use Real Words.
Anirudh Gaur
Greenhorn

Joined: May 11, 2011
Posts: 5
Anirudh Gaur wrote:How to add rows dynamically in a jtable?

Darryl Burke wrote: That all depends on what exactly you mean by dynamically.

Each time the user inputs the data, my code should be able to feed this data into the jtable by creating a new row(or by finding an empty one).


Anirudh Gaur wrote:I did not find any specific method for adding rows.

Darryl Burke wrote:Have you looked at the methods of DefaultTableModel?

i think it is supposed to be addRow() or insertRow(), but what's the difference in them,i did not get it fully.

Anirudh Gaur wrote:Help plzz.....
Darryl Burke wrote:Please Use Real Words
.

Sorry for this...


and thanks for your concern.
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2182
    
    7
i think it is supposed to be addRow() or insertRow(), but what's the difference in them,i did not get it fully.


Try each of them to see what the difference is.
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4542
    
    5

Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 1337

Nice post count, Rob ;)
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2182
    
    7
Darryl Burke wrote:
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 1337

Nice post count, Rob ;)


Sorry, Darryl, I"m not sure the exact significance of that number. Its similiar to yours, but not exact.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19693
    
  20

1337
Darryl's just being a nerd


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2182
    
    7
Rob Spoor wrote:1337
Darryl's just being a nerd


You learn something new every day.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: adding rows in jTable