Posted By:
Paul_Connaughton
Posted On:
Thursday, April 11, 2002 04:38 AM
How are you adding the node to the JTree?
If you add it directly to a DefaultMutableTreeNode like so:
((DefaultMutableTreeNode)myJTree().getModel().getRoot()).add( myChildNode );
then no events are generated and the JTree is not updated on the screen.
However if you make changes through the DefaultTreeModel like this:
((DefaultTreeModel)myJTree.getModel()).insertNodeInto( myChildNode, (DefaultMutableTreeNode)myJTree().getModel().getRoot(), 0 );
Then the events are triggered and the UI is updated.