I’m using a custom TreeModel for a JTree. I have an issue when I insert a new node into my TreeModel, and then call treeNodesInserted(TreeModelEvent) on all my TreeModelListeners.
I think the issue has to do with the fact that JTree.TreeModelHandler has no implementation for treeNodesInserted(e), only treeStructureChanged(e)
obviously for me it would be a lot better to be able to insert, instead of a full tree structure changed.
Is there a workaround? (I can’t use DefaultTreeModel)
Some more details would help. But I have done a similar thing with no issues. In my case I’ve got MyTreeModel implements TreeModel, and a fireTreeInserts function is part of it.
The function looks something like this (cleaned application specific code):