void () { myRoot.removeAllChildren(); DefaultProxyGroup defaultProxyGroup = myManager.getDefaultGroup(); defaultProxyGroup = (defaultProxyGroup == null) ? new DefaultProxyGroup(Collections.emptyMap()) : defaultProxyGroup; final Map<String, ProxyGroup> userGroups = myManager.getGroups(); myRoot.add(createNodeForObject(defaultProxyGroup)); for (Map.Entry<String, ProxyGroup> entry : userGroups.entrySet()) { myRoot.add(createNodeForObject(entry.getValue())); } TreeUtil.sortRecursively(myRoot, GroupNodesComparator.getInstance()); ((DefaultTreeModel) myTree.getModel()).reload(myRoot); }