Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

adding rows in jTable

 
Anirudh Gaur
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5148
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2617
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5148
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 1337

Nice post count, Rob ;)
 
Rob Camick
Ranch Hand
Posts: 2617
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20669
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1337
Darryl's just being a nerd
 
Rob Camick
Ranch Hand
Posts: 2617
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Spoor wrote:1337
Darryl's just being a nerd


You learn something new every day.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic