Expand Collapse Expand Issue with JTree Lazy loading

后端 未结 2 1247
半阙折子戏
半阙折子戏 2021-01-01 02:02

I have implemented a tree using Lazy Loading. The 1st level nodes are created at the time of tree creation, where as the child nodes are created only when a user expands any

2条回答
  •  梦毁少年i
    2021-01-01 03:02

    Once a node has populated, simple don't repopulate it. On treeExpanded, simply check to see of the parent node has any children, if it does, don't reload anything.

    You will need to supply the ability to refresh a parent node. I normally do this with a JPopupMenu.

提交回复
热议问题