I have a JTree
where children are instances of my class inheriting from DefaultMutableTreeNode
.
At the beginning the tree has 10 nodes with two levels. Then I add children into some nodes, using add()
method in my class. Then I reload my tree model:
tree.setModel(root) // root is an instance of my class.
The children are added and everything works fine. But a problem appears when I want to set the selection path (expanding added children using tree.setSelectionPath(path)
). Then most nodes are truncated as if they were too long (I see an ellipsis like node).
How can this problem be solved. After commenting setSelectionPath(path)
line and expanding the nodes manually, everything works fine.