Results 1 to 7 of 7
  1. #1
    hassaanid2012 is offline Member
    Join Date
    Apr 2012
    Location
    Pakistan
    Posts
    20
    Rep Power
    0

    Default How to Refresh JTable all contents?

    Hello Guys!!!

    I have one JTable and two JButton (Insert, Refresh) and MS Access DB connected with my Java Program. When i add some data in my MS Access Table through Insert button my JTable is not shown the entered data that's why i create a new Refresh button but i don't know how to refresh all rows and columns values of JTable by pressing Refresh button. Can anybody help me in this problem? Any help is greatly appreciated..... Thanks!!!! :)

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,335
    Blog Entries
    7
    Rep Power
    20

    Default Re: How to Refresh JTable all contents?

    Read all about it in the API documentation for the tableChanged( ... ) method in the JTable class.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

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

    Default Re: How to Refresh JTable all contents?

    Beside saving the data in the database you need to update your JTable's TableModel data so that it include the latest data inserted into your MS Access Database. For the current code how do you manage the data inside the JTable?

  4. #4
    hassaanid2012 is offline Member
    Join Date
    Apr 2012
    Location
    Pakistan
    Posts
    20
    Rep Power
    0

    Default Re: How to Refresh JTable all contents?

    Thanks 4 your reply!!! But anybody can tell me how to get all values of specified column from JTable?

  5. #5
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: How to Refresh JTable all contents?

    Quote Originally Posted by hassaanid2012 View Post
    Thanks 4 your reply!!! But anybody can tell me how to get all values of specified column from JTable?
    Have you had a look at the JTable tutorial and API? I'll bet you can figure it out after looking at these.

  6. #6
    hassaanid2012 is offline Member
    Join Date
    Apr 2012
    Location
    Pakistan
    Posts
    20
    Rep Power
    0

    Default Re: How to Refresh JTable all contents?

    where is jtable tutorial and api post link here :)

  7. #7
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: How to Refresh JTable all contents?

    Google JTable tutorial, and it's the first hit. The tutorial will have links to the API, but regardless, if you're going to be doing any Java programming, you should have links saved to the Java tutorials and the Java API. They should become your new best friends.

Similar Threads

  1. jtable refresh
    By seredi in forum AWT / Swing
    Replies: 2
    Last Post: 02-07-2012, 09:36 AM
  2. Refresh JTable data
    By pink123 in forum AWT / Swing
    Replies: 1
    Last Post: 03-31-2011, 06:18 PM
  3. Could not able to refresh JTable.
    By pratim in forum AWT / Swing
    Replies: 3
    Last Post: 03-28-2011, 01:52 PM
  4. how to refresh the contents of a JPanel
    By pratim in forum AWT / Swing
    Replies: 1
    Last Post: 03-13-2011, 06:28 PM
  5. how to refresh data of the JTable
    By paty in forum JDBC
    Replies: 3
    Last Post: 08-17-2008, 12:01 PM

Posting Permissions

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