The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
July 2000

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Wonderfull method !!!

Posted by Kroczek Vincent on February 12, 2002 at 5:22 AM

I have found a good method to avoid to add spaces to the name
of the JTree node (it doesn't work in all the cases).

It's simple :

1) Suppose you built your JTree on the basis of a DefaultTreeModel.

===>
DefaultTreeModel treeModel = new DefaultTreeModel(my_top_node);
JTree myjtree = new JTree(treeModel);

2) After changing the name of your node simply use the following command :

treeModel.nodeChanged(the_node_which_changed);


It works !!!!!!!!!!

LOL








Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us