Updating ImageIcon in JTree without repainting the Tree?

后端 未结 2 907
感情败类
感情败类 2020-12-02 02:58

Basically I edit an attribute private string status=\"OK\" in the UserObject() of a DefaultTreeNode().

I have a CustomRenderer

2条回答
  •  广开言路
    2020-12-02 03:30

    When you want the model to be updated, as you do here, you are correct that you want to call nodeChanged. What I think may be wrong is that you are passing in an entirely new node, which obviously doesn't match one found in the tree. Try passing in a reference to the node in the tree you modified - that way the model can find know which node you modified.

提交回复
热议问题