code: public void setInputModel(TreeModel model)
      {
          Enumeration<TreePath> expandedDescendants = 
              this.tree.getExpandedDescendants(new TreePath(treeModel.getRoot()));
          
          this.treeModel = new FilteredTreeModel(model);
          this.tree.setModel(treeModel);
          
          if (expandedDescendants != null)
          {
              while (expandedDescendants.hasMoreElements())
              {
                  TreePath expanded = expandedDescendants.nextElement();
                  TreePath translatedPath = 
                      JTrees.translatePath(treeModel, expanded);
                  if (translatedPath != null)
                  {
                      this.tree.expandPath(translatedPath);
                  }
              }
          }
      }
docs: Set the (unfiltered) model for the tree
  
  @param model The model for the tree