JTree, strange problem

I created a JTree on top of a DefaultMutatableTreeNode by using the constructor JTree(TreeNode root)

I tried removing all leaf nodes of the model, using node.removeFromParent(). And unsurprisingly the UI is automatically updated.

After that, i reinsert new leaf nodes(they are new instances having new physical address) into the model, using parent.add(node). And unsurprisingly, the UI is automatically updated. The JTree looks powerful at the moment, i am quite satisfied with it.

However the nightmare comes, when i click on the leaf nodes on the UI and the getLastSelectedPathCompoent() mystically returned the already-removed leaf nodes but not the newly-inserted leaf nodes.

I tried debugging for a couple of hours, but failed! I think i am doing something really wrong :( Anyone help me out? Thanks a lot!

[843 byte] By [yslee4a] at [2007-10-3 8:44:26]
# 1
problem solved:)solved by calling the updateUI() for the removal operation.....
yslee4a at 2007-7-15 3:53:14 > top of Java-index,Desktop,Core GUI APIs...