DefaultTreeModel treeModel = (DefaultTreeModel) navigatorTree.getModel(); TreePath treePath = navigatorTree.getSelectionPath(); DefaultMutableTreeNode projectNode = (DefaultMutableTreeNode) treePath.getPath()[1]; treeModel.insertNodeInto( new DefaultMutableTreeNode(analysisRun), projectNode, projectNode.getChildCount());
RunAnalysisDialog dialog = new RunAnalysisDialog(this, analysisRun); dialog.setSize(400, 300); dialog.show();  if (dialog.isCompleted()) {  DefaultTreeModel treeModel = (DefaultTreeModel) navigatorTree.getModel(); TreePath treePath = navigatorTree.getSelectionPath(); DefaultMutableTreeNode projectNode = (DefaultMutableTreeNode) treePath.getPath()[1]; treeModel.insertNodeInto( new DefaultMutableTreeNode(analysisRun), projectNode, projectNode.getChildCount()); }
    private void findBugsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_findBugsButtonActionPerformed        Project project = getCurrentProject();        AnalysisRun analysisRun = new AnalysisRun(project);        DefaultTreeModel treeModel = (DefaultTreeModel) navigatorTree.getModel();        TreePath treePath = navigatorTree.getSelectionPath();        DefaultMutableTreeNode projectNode = (DefaultMutableTreeNode) treePath.getPath()[1];        treeModel.insertNodeInto(            new DefaultMutableTreeNode(analysisRun), projectNode, projectNode.getChildCount());    }//GEN-LAST:event_findBugsButtonActionPerformed