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!

