At startup, the nodes are read in via a custom TreeModel and initial checkbox selections are made during the #treeNodesInserted() callback of the TreeModelListener. I set the intial states using #addSelectionPath(). The nodes appear fine in the tree and are checked as expected. It looks something like this:
- Code: Select all
x -- Group
x -- node
x -- node
x -- node
x -- node
x -- node
However, the first time I check/uncheck any single "node" in the GUI:
- Code: Select all
x -- Group
x -- node
x -- node
O -- node
x -- node
x -- node
I get two TreeSelectionEvents:
- In the first one, "e" shows the "Group" node as areNew=[false] which is correct.
- A second TreeSelectionEvent has "e" with ALL the node elements showing areNew=[true,true,true,true,true]. These nodes are NOT new so this is making it very difficult to determine which nodes have been checked and which ones have been unchecked.