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: problem with JTable

  1. #1
    Member
    Join Date
    Jan 2012
    Posts
    57
    My Mood
    Fine
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default problem with JTable

    hii friends

    here i am trying to show the all records of an employee on a button click .. for that i am using the JTable over the frame i have done this but the problem that i am facing is that if i pressed that button again then it is appending the data which is already stored in the database .. so every time i pressed the button it appends the same data to the table model .. how to resolve this .. plzz specify any method or property which is in JTable ....
    Last edited by deependeroracle; March 9th, 2012 at 11:06 PM.


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: problem with JTable

    You have not provided information as to how you are updating the JTable data model, which is important to your problem. Do you remove the previous data from the data model prior to updating with the new data?

  3. #3
    Member
    Join Date
    Jan 2012
    Posts
    57
    My Mood
    Fine
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default Re: problem with JTable

    yes i want to remove the previous data ..

  4. #4
    Member
    Join Date
    Feb 2012
    Posts
    58
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default Re: problem with JTable

    Probably you are using some kind of collection to store data in the table model, so before loading data from database, you should empty the collection, then append data to the collection.

Similar Threads

  1. JTable
    By adra in forum Java Theory & Questions
    Replies: 5
    Last Post: August 30th, 2011, 07:05 AM
  2. [SOLVED] JTable Problem
    By aussiemcgr in forum Java Theory & Questions
    Replies: 0
    Last Post: October 15th, 2010, 04:33 PM
  3. Hello everyone! I need help with JTable
    By hektor in forum AWT / Java Swing
    Replies: 6
    Last Post: October 11th, 2010, 10:11 AM
  4. Problem with updating empty JTable
    By byubi in forum AWT / Java Swing
    Replies: 1
    Last Post: May 15th, 2010, 02:06 AM
  5. Problem of getting result than SQL to JTable
    By MS_Dark in forum Exceptions
    Replies: 1
    Last Post: March 10th, 2009, 06:26 AM