projectCollection.addProject(project); DefaultMutableTreeNode projectNode = new DefaultMutableTreeNode(project); DefaultTreeModel treeModel = (DefaultTreeModel) navigatorTree.getModel(); treeModel.insertNodeInto(projectNode, rootNode, rootNode.getChildCount()); TreePath projPath = new TreePath(new Object[]{rootNode, projectNode}); navigatorTree.makeVisible(projPath); navigatorTree.setSelectionPath(projPath);
addProject(project);
    private void newProjectItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newProjectItemActionPerformed	String projectName = "<<project " + (++projectCount) + ">>";	Project project = new Project(projectName);	projectCollection.addProject(project);	DefaultMutableTreeNode projectNode = new DefaultMutableTreeNode(project);	DefaultTreeModel treeModel = (DefaultTreeModel) navigatorTree.getModel();	treeModel.insertNodeInto(projectNode, rootNode, rootNode.getChildCount());	TreePath projPath = new TreePath(new Object[]{rootNode, projectNode});	navigatorTree.makeVisible(projPath);	navigatorTree.setSelectionPath(projPath);    }//GEN-LAST:event_newProjectItemActionPerformed