Results 1 to 4 of 4

Thread: table help

  1. #1
    Reeling is offline Member
    Join Date
    Jan 2012
    Posts
    49
    Rep Power
    0

    Default table help

    I am trying to find a way to add rows to my table. It is a swing jtable. Every example i've seen says that model.insertRow(0,new Object[]{"Ranjan","50"}); should work but it doesn't.
    i'm really just completely lost and have no idea since the jdoc doesn't seem to have it in there or i'm looking in the wrong place.
    Last edited by Reeling; 06-02-2012 at 07:57 AM.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is online now Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,236
    Rep Power
    19

    Default Re: table help

    To get better help sooner, post a SSCCE (Short, Self Contained, Correct (Compilable), Example) that demonstrates the problem. Without that, we would be just guessing what you did wrong, and any suggestions would be likely to be way off the mark.

    I can't see where JDBC comes into this.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is online now Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,236
    Rep Power
    19

    Default Re: table help

    Quote Originally Posted by Reeling View Post
    It is a swing jtable.
    No, it's a Swing JTable. This is a programming forum; please capitalize words correctly.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #4
    wsaryada is offline Senior Member
    Join Date
    Jun 2007
    Location
    Bali, Indonesia
    Posts
    760
    Rep Power
    8

    Default Re: table help

    Yes, you can insert a new row in JTable using DefaultTableModel's insertRow(int row, Object[] rowData). Please show us how you did it, and if you have any error stack trace you can also include it so we can have a better idea.

Similar Threads

  1. Replies: 3
    Last Post: 02-23-2012, 09:30 AM
  2. Replies: 1
    Last Post: 09-27-2011, 06:06 AM
  3. table
    By NidaSahar in forum JDBC
    Replies: 5
    Last Post: 03-16-2011, 09:49 AM
  4. Copy Default table model to another default table model?
    By greatmajestics in forum AWT / Swing
    Replies: 2
    Last Post: 04-28-2010, 04:08 PM
  5. Replies: 1
    Last Post: 01-08-2010, 06:19 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •