private void applySelected(final JTree tree, final DefaultMutableTreeNode node) { TreeUtil.unselect(tree, node); List<TreePath> selectionPaths = new ArrayList<TreePath>(); for (List<PathElement> pathElements : mySelectedPaths) { applySelectedTo(pathElements, tree.getModel().getRoot(), tree, selectionPaths); } if (selectionPaths.size() > 1) { for (TreePath path : selectionPaths) { tree.addSelectionPath(path); } } }