The Jtree is not refreshing with new values when mouse click on the node
843805Aug 31 2005 — edited Aug 31 2005hi ,
I am creating a tree from a vector .The values in the vector is coming from the JTable data after satisfing the some condition. But the data in the Jtable is changing time to time so the data in the vector is also changing .
But the problem is that when first I create a tree with that data the tree is created but for the next time I click on the tree node the tree is not changing i.e. it is not created with the new values that is stored in the vector at that time .what to do .Please help
I am using DefaultMutableTreeNode for creating the tree .In starting I have created one root and the one it's child .Now the next subtree of the root child have to be created by this vector data. this subtree should be updated according to the values in the vecter.
public void valueChanged(TreeSelectionEvent e) {
//code here
subtreecreat();
//some function that create tree after cheching the some condition here
}
subtreecreat() {
Enumeration en=vector.elements();
while(en.hasMoreElements())
{
DefaultMutableTreeNode servername = new DefaultMutableTreeNode(en.nextElement());
node.add(servername);
}
Please help it is very urgent
Thanks in Advance,
anum