Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JTree refresh when node added  RSS feed

 
Swamy Vatti
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys...
I have problem.... When I add a node thru a JDialog it creates a record in the database and gives me the tree model. everything works fine upto here. But when I set the tree model to the new one its not getting updated on the screen...
Do you guys see any reason...
 
rnandam
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
This is becoz the JTREE is not getting refreshed after the new node is added to the DB.
This can be done by using CACHE concept(Like u use in the WEBLOGIC).
U write a method just after u add a NODE to the JTREE. which get the data from the DB and put all the data in a hash Table and reload the data to the screen...
Regards,
Nandam
 
Swamy Vatti
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Got the answer...
load the model again from the nodes by using
model.reload()...
works perfect.
Thanks for the response
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!