• Post Reply Bookmark Topic Watch Topic
  • New Topic

need help about add row  RSS feed

 
yesaya handoyo
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys..i need help about adding row to jtable..These are the codes that i've make using netbeans..

 
Brian Cole
Author
Ranch Hand
Posts: 949
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by yesaya handoyo:
i need help about adding row to jtable..These are the codes that i've make using netbeans..


If you had created a thread on a cooking forum and wrote "I need help about making a cake..These are the ingredients that I'm using," what kind of response would you expect?

I'd expect something like "Ok, have fun with that" or "Don't forget to grease the pan." I wouldn't expect anything more specific because you haven't actually asked a question.

You forgot the part where you say something like "when I add the lemon juice the batter curdles, how do I prevent that?"
 
Campbell Ritchie
Marshal
Posts: 55760
163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And please use the code button; your un-indented code is difficult to read.
 
yesaya handoyo
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the code that i get from netbeans forum and it works for me
 
Brian Cole
Author
Ranch Hand
Posts: 949
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by yesaya handoyo:
This is the code that i get from netbeans forum and it works for me


Note that you still haven't specified what you are trying to ask. If that code satisfies your need, then more power to you. I'm not sure why you need the tablename.setModel(dtm) part, though.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Brian Cole:
I'm not sure why you need the tablename.setModel(dtm) part, though.


Probably the person from the "netbeans forum" missed out on the fireTableDataChanged() or such similar methods.
 
Rob Spoor
Sheriff
Posts: 21092
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which are automatically called by DefaultTableModel.
 
yesaya handoyo
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My question is how to add a row when i press enter on the last column of a row..The code i got works fine with me..Please help me if you guys have a better idea...Thanks a lot..
 
Rob Spoor
Sheriff
Posts: 21092
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you get that event? Either from the JTable, a cell editor or the TableModel?
 
yesaya handoyo
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use it in the TableModelListener and it works for me..Thanks...
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!