I have a problem with inserting nodes in a JTree. Basically the user right clicks on a parent node, bringing up a list of the possible children to insert. They select one it is inserted as a child of the selected node. This all works great when the parent node has never been expanded. However, if the parent node of the node the user is trying to insert has EVER been expanded, the UI doesn't seem to update accordingly.
Here are the relevant lines of code:
Creating the JTree: this.tree = new JTree(ctlr.getRulesTableTreeModel().getModel());
The getModel() method returns a DefaultTreeModel models the original tree hierarchy.
Inserting a Node: this.treeModel.insertNodeInto(child, parent, index);
Sorry for not giving more code, but this project is like 3000 lines long, I'm trying to pick out the relevant lines.