0

I need to notify a node's children changed, and for what I've seen from various sources (e.g. here) I need to act on the JTreeModel. The problem is I don't have either the JTree object nor the JTreeModel object. All I have are the tree's nodes.

Is there a way?

balsick
  • 1,099
  • 1
  • 10
  • 23
  • 1
    Short answer - no, and it's very, very annoying. A `TreeNode` is sub model of `TreeModel` and it should be able to generate events which the model listens to, but it's not implemented that way, and it's very annoying – MadProgrammer Feb 16 '18 at 11:53
  • I ended up writing my JTreeModel into the root TreeNode. So annoying. – balsick Feb 17 '18 at 15:52
  • I've, in the past, create a event listener into `TreeNode` which generates events in such away that the `TreeModel` listens to the root node and each parent node listens to it's children, the events are then cascaded back up the call chain – MadProgrammer Feb 17 '18 at 22:08

0 Answers0