I have a panel that contains a checkboxTree , I populate the tree when open the panel , the problem is when i have to much items to be selected in the checkboxtree (about 4000) the panel take a long time to open . this is my code:
checkBoxTree.getCheckBoxTreeSelectionModel().setDigIn(true);
List<TreePath> paths = new ArrayList<TreePath>();
Enumeration<?> e = projectNode.breadthFirstEnumeration();
while (e.hasMoreElements())
{
IconNode node = (IconNode) e.nextElement();
if(node.isLeaf() && node.isSelected())
paths.add(new TreePath(node.getPath()));
}
TreePath[] array = new TreePath[paths.size()];
array = paths.toArray(new TreePath[0]);
checkBoxTree.getCheckBoxTreeSelectionModel().setSelectionPaths(array);
any suggestions will be welcomed :) ,