Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JTree how to delete a node??

843804Nov 9 2004 — edited Nov 25 2004
Hello !
I am trying to use a JTree in a java application.
The problem is that once the tree is drawn, I need to remove some of its nodes . So I use either "removeNodeFromParent " or "removeNode" methods. This goes well (the DefaultTreeNode is actually deleted from the parent ), but the "drawn node" (its representation in the tree) remains in the tree and I have no idea how to make it disappear . I tried the method updateUI() on the panel which contains the tree. I also tried the method "fireTreeNodesRemoved " on the DefaultTreeModel related to this tree, but nothing really works :((
Can you help me?
Thank you very much.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 23 2004
Added on Nov 9 2004
3 comments
426 views