• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

dynamically removing leaf from Jtree

 
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I am writting a Jtree that needs to do the following.
1)When a node is expaneded a leaf is displayed say "Loading Please Wait".
2)The system the loads the data
3)Once loaded the "Loading Please Wait" is removed
4)New children are then added to the expanded node.
However I have a small problem:
I using a TreeExpansionListener and have the following code.

However the new leaf "loaded" is not displayed.
I first but this down to the probelm that the tree was not being repainted. So I added tree.validate() and tree.repaint() but that did not help. So thinking it was a problem with my load code I removed that to. I am sure that the node I am removing and adding the leaf to is correct. Has anyone got any ideas?

Thanks
Chris
[ November 13, 2003: Message edited by: Chris Harris ]
 
Chris Harris
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ohh, I have only been removing it from the view not the model!!!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic