I dug through the forums for some time looking for a solution to this and must have missed it. I have been evaluating the library and am pleased so far but having issues with dynamic node updates.
I am using CheckBoxTree with a DefaultTreeModel. The toString() method of the nodes user object changes over time, and when I make this change I use this bit of code to update the node:
- Code: Select all
DefaultTreeModel model = (DefaultTreeModel)tree.getModel();
model.nodeChanged(node);
What I end up seeing is the original text label of the node with "..." following. Debug output confirms that toString() is returning the string I expect. Currently I am just changing the text of node, but later I will be modifying the icons dynamically as well. What is the proper way to get the UI to refresh properly.
This is being run outside of the UI event thread but it's wrapped in a runnable and invoked with invokeLater();
Thanks in advance,
Peter