Results 1 to 4 of 4
  1. #1
    neha_negi is offline Member
    Join Date
    Sep 2008
    Posts
    3
    Rep Power
    0

    Default Inside a Timer thread loop,how to refresh a JTable in swing

    Hello everybody,
    I am using a timer thread loop and inside that loop i am featching the data from a datagrampacket,and update a JTable by using

    table.setValueAt(value,row ,column);

    and after that, by using repaint() method refreash the JTable.But the values are not view on the JTable .
    But when print the table data inside the thread loop ,

    System.out.println(table.getValueAt(rownum,0));

    that value of the table(row,col) print in console.

    Please help me to repaint the JTable inside a timer thread loop.

    Thanks
    Last edited by neha_negi; 09-17-2008 at 01:46 PM.

  2. #2
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    7

    Default not a threading issue

    Then it is a GUI issue. Yes, it sounds like threads but repaint probably should be update and so on. The have a boilerplate in Swing using invokeLater that works correctly, digging through repaint is unproductive.
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

  3. #3
    neha_negi is offline Member
    Join Date
    Sep 2008
    Posts
    3
    Rep Power
    0

    Default

    Thanks sir......
    I will use Swingutilities.invokeLater.

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

Similar Threads

  1. Once again: waiting in a thread loop.
    By willemjav in forum Threads and Synchronization
    Replies: 115
    Last Post: 09-22-2008, 01:35 PM
  2. Swing problem: JTable/TableModel
    By Levish2002 in forum AWT / Swing
    Replies: 2
    Last Post: 08-24-2008, 08:53 PM
  3. how to refresh data of the JTable
    By paty in forum JDBC
    Replies: 3
    Last Post: 08-17-2008, 12:01 PM
  4. Replies: 1
    Last Post: 07-26-2008, 05:26 PM
  5. freezing when use socket.accept() inside of a thread
    By tamayo in forum Advanced Java
    Replies: 0
    Last Post: 07-23-2007, 11:48 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
  •