I am using JTree to display channels and members on a network application.
What I wanted to ask is how should I handle the case where members move to different channels.
Should I create the tree again (generated from List some objects are other lists) or
I can do that dynamically(tree needs to be final to add listeners) .
Also how would each case affect the performance? The tree isn’t huge something like 10 parents 10 leaf.
1) you can recreate and populate JTree from its
Model, descriptions about DefaultTreeModel, examples here2) all changes for GUI would be moved to the BackGround Task(s), please look at
SwingWorkerorRunnable#Thread(most easiest way), butRunnable#Threadrequired wrapping all output (Swing methods) to the invokeLater