Skip to main contentdfsdf

    • public DefaultMutableTreeNode addObject(DefaultMutableTreeNode parent,  Object child,  boolean shouldBeVisible) {  DefaultMutableTreeNode childNode =  new DefaultMutableTreeNode(child);  ...  treeModel.insertNodeInto(childNode, parent,  parent.getChildCount());   //Make sure the user can see the lovely new node.  if (shouldBeVisible) {  tree.scrollPathToVisible(new TreePath(childNode.getPath()));  }  return childNode; }
    • Note that although DefaultMutableTreeNode has methods for changing a node's content, changes should go through the DefaultTreeModel cover methods. Otherwise, the tree model events would not be generated, and listeners such as the tree would not know about the updates.

    2 more annotations...

1 - 3 of 3
20 items/page
List Comments (0)