I created JTree , and some of its nodes are customizable to show them as extensible, although they have no children (for now). I executed this thread to implement this.
Why? I want to load the tree dynamically, so when the tree expands, I retrieve additional information from the server and display it on the tree.
The problem I am facing is that when I expand one of these nodes, it becomes selected, which is not the default behavior for the default nodes (you can expand them without changing the tree selection).
How to solve this problem to prevent selection of this node when expanding?
source share