jtree
4 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Maheshwar_Reddy
Posted On:   Tuesday, August 28, 2001 05:52 AM

hello all,

After adding a new node to the exising jtree, how do i update the jtree to show the now node immediately without doing any functionality.

Regards
mahesh.

Re: jtree

Posted By:   Roy_thomas  
Posted On:   Friday, March 8, 2002 02:09 AM

Here it is;

DefaultTreeModel treemodel=(DefaultTreeModel)tree.getModel();
DefaultMutableNode newnode=new DefaultMutableNode("NodeText");
treemodel.insertNodeInto (newnode,parent,parent.getChildCount());


//new node is the one you are goint to add to the tree
//parent is the path where you want to add
// childcount is the index

Re: jtree

Posted By:   Prashanth_Godey  
Posted On:   Tuesday, August 28, 2001 03:06 PM

try

tree.updateUI();

Re: jtree

Posted By:   amit_vijayant  
Posted On:   Tuesday, August 28, 2001 01:17 PM

Did you try to 'repaint' the panel holding your JTree?

Re: jtree

Posted By:   amit_vijayant  
Posted On:   Tuesday, August 28, 2001 01:17 PM

Did you try to 'repaint' the panel holding your JTree?
About | Sitemap | Contact