Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem repainting JTable  RSS feed

 
Joe Guzzardo
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using a JTable with an AbstractTableModel. I can load and display a table with no problem but when I display another list of data and attempt to use the scrollbar on the browser, the data from the original JTable list reappears and overlays the current JTable list data. Any ideas?
 
sridevi sangaiah
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried revalidating the jtable?
 
Joe Guzzardo
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I finally got it working. The trick is to extend the AbstractTableModel class, create a constructor for this class, and use it to load the table. I then added another method to perform a table reload, similar to what the constructor did, then a simple repaint call displayed the table properly without loss of data from sucessive table displays. It wasn't that hard really and if anyone is interested I can post the code here.
 
wip siva
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi friend
i am also working in JTree and JTable.by clicking the JTtree leafs(multiple selection) i have to display the live data in the table to the appropriate rows and columns.if u have worked this kind of task and if u have code plz kindly send me.
any code dynamic updation of Jtree and JTable .
mail me to 123knock@usa.net
bye
 
wip siva
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi friend
i am also working in JTree and JTable.by clicking the JTtree leafs(multiple selection) i have to display the live data in the table to the appropriate rows and columns.if u have worked this kind of task and if u have code plz kindly send me.
any code dynamic updation of Jtree and JTable .
mail me to 123knock@usa.net
bye
 
wip siva
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi joe
i am also working in same kind of application .i need to display the live data on a Jtable.
i would like to have the code.if u dont mind.and
i need ur help for this swing application.bcz i am very new
to this swing.
my mail id is
123knock@usa.net
 
wip siva
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi joe
i am also working in same kind of application .i need to display the live data on a Jtable.
i would like to have the code.if u dont mind.and
i need ur help for this swing application.bcz i am very new
to this swing.
my mail id is
123knock@usa.net
 
Brand Burns
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Joe Guzzardo:
I finally got it working. The trick is to extend the AbstractTableModel class, create a constructor for this class, and use it to load the table. I then added another method to perform a table reload, similar to what the constructor did, then a simple repaint call displayed the table properly without loss of data from sucessive table displays. It wasn't that hard really and if anyone is interested I can post the code here.

Joe,
I am interested in your solution for a problem I thought was a dead-end, without large amounts of UI code. I just joined this newsgroup and am not sure how to get code. Any help would be greatly appreciated.
Brand Burns
brandburns@earthlink.net
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!