Iterator j = bugInstance.annotationIterator(); while (j.hasNext()) { BugAnnotation annotation = (BugAnnotation) j.next(); DefaultMutableTreeNode annotationNode = new DefaultMutableTreeNode(annotation); bugTreeModel.insertNodeInto(annotationNode, bugNode,  bugNode.getChildCount()); }
    private void findBugsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_findBugsButtonActionPerformed        Project project = getCurrentProject();        AnalysisRun analysisRun = new AnalysisRun(project);                // Run the analysis!        RunAnalysisDialog dialog = new RunAnalysisDialog(this, analysisRun);        dialog.setSize(400, 300);	dialog.setLocationRelativeTo(null); // center the dialog        dialog.show();        if (dialog.isCompleted()) {            // Create a navigator tree node for the analysis run            DefaultTreeModel treeModel = (DefaultTreeModel) navigatorTree.getModel();            TreePath treePath = navigatorTree.getSelectionPath();            DefaultMutableTreeNode projectNode = (DefaultMutableTreeNode) treePath.getPath()[1];            DefaultMutableTreeNode analysisRunNode = new DefaultMutableTreeNode(analysisRun);            treeModel.insertNodeInto(analysisRunNode, projectNode, projectNode.getChildCount());            // Create a DefaultTreeModel to be used in the BugTree for this analysis run            DefaultMutableTreeNode bugRootNode = new DefaultMutableTreeNode();            DefaultTreeModel bugTreeModel = new DefaultTreeModel(bugRootNode);            analysisRun.setTreeModel(bugTreeModel);                        // FIXME: temporary hack            {                Cursor orig = this.getCursor();                this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));                                Iterator i = analysisRun.getBugInstances().iterator();                while (i.hasNext()) {                    BugInstance bugInstance = (BugInstance) i.next();                    DefaultMutableTreeNode bugNode = new DefaultMutableTreeNode(bugInstance);                    bugTreeModel.insertNodeInto(bugNode, bugRootNode, bugRootNode.getChildCount());                }                                this.setCursor(orig);            }                        // Make the new node the currently selected node            TreePath path = new TreePath(new Object[]{rootNode, projectNode, analysisRunNode});            navigatorTree.makeVisible(path);            navigatorTree.setSelectionPath(path);        }    }//GEN-LAST:event_findBugsButtonActionPerformed