I have a problem which was also described here.
I have the invertExpand method in MyTree class which works like this:
public void invertExpand(DefaultMutableTreeNode node) { TreePath path = new TreePath(node.getPath()); // no better way to get TreePath from TreeNode :( if (!isExpanded(path)) { expandPath(path); } else { collapsePath(path); } } But the problem is isExpanded() method uses the HashMap to store the expanded paths. It seems that isExpanded() never returns true for newly created TreePath. (But they are expanded really)
Does any way to fix that issue?