tree.scrollPathToVisible(path);
  void selectPath(JTree tree, TreePath path)  {    if (path != null)      {        if (tree.getSelectionModel().getSelectionMode() == TreeSelectionModel.SINGLE_TREE_SELECTION)          {            tree.getSelectionModel().clearSelection();            tree.addSelectionPath(path);            tree.setLeadSelectionPath(path);          }        else if (tree.getSelectionModel().getSelectionMode() == TreeSelectionModel.CONTIGUOUS_TREE_SELECTION)          {            // TODO          }        else          {            tree.addSelectionPath(path);            tree.setLeadSelectionPath(path);            tree.getSelectionModel().setSelectionMode(                                                      TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);          }      }  }