• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

need help about add row

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..

 
Author
Posts: 986
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?"
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is the code that i get from netbeans forum and it works for me
 
Brian Cole
Author
Posts: 986
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which are automatically called by DefaultTableModel.
 
yesaya handoyo
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I use it in the TableModelListener and it works for me..Thanks...
 
reply
    Bookmark Topic Watch Topic
  • New Topic