Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: add values in JTable

  1. #1
    Junior Member
    Join Date
    Feb 2013
    Location
    kathmandu, nepal
    Posts
    29
    My Mood
    Cheerful
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default add values in JTable

    this is what i have done
    String fields[]={"Full name", "Last name", "Age"};  //for table
    		String data[][]={{"Shakti","Raj","20"},{"Pranish","Shrestha","19"},{"Samrat","Pradhan","19"}};
     
    		JT = new JTable(data,fields);
    		sp =new JScrollPane(JT);
    result_Panel.add(sp);

    now how to add more


  2. #2
    Junior Member
    Join Date
    Feb 2013
    Location
    kathmandu, nepal
    Posts
    29
    My Mood
    Cheerful
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Adding fields to a table

    this is what i have done
    String fields[]={"Full name", "Last name", "Age"};  //for table
    		String data[][]={{"Shakti","Raj","20"},{"Pranish","Shrestha","19"},{"Samrat","Pradhan","19"}};
     
    		JT = new JTable(data,fields);
    		sp =new JScrollPane(JT);
    result_Panel.add(sp);

    now how to add more

  3. #3
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: Adding fields to a table

    Please read: How to help yourself get help and try to improve the question.

  4. #4
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: add values in JTable

    Please do not waste our time by double posting on this forum. We waste our time slapping you on the hand and organizing your mess, we have no time left to answer your question.
    Threads merged.

Similar Threads

  1. Beginniner - Add Row to JTable
    By steme in forum Java Theory & Questions
    Replies: 0
    Last Post: June 8th, 2013, 02:59 PM
  2. Im having a problem in retrieving values from jTable.
    By ZDreamer08 in forum What's Wrong With My Code?
    Replies: 6
    Last Post: May 22nd, 2013, 10:21 AM
  3. How to add into Jtable more than 100000 records
    By serdar in forum Exceptions
    Replies: 3
    Last Post: July 28th, 2011, 10:09 AM
  4. JTable Updating String Values from User Input
    By aussiemcgr in forum AWT / Java Swing
    Replies: 5
    Last Post: August 3rd, 2010, 01:48 PM
  5. Add or remove a row on a jtable with Netbeans 6.0
    By Pieter in forum Java Theory & Questions
    Replies: 1
    Last Post: July 8th, 2010, 02:40 PM