tree.revalidate();
    public void treeStructureChanged(TreeModelEvent e)    {      if (e.getPath().length == 1          && !e.getPath()[0].equals(treeModel.getRoot()))        tree.expandPath(new TreePath(treeModel.getRoot()));      updateCurrentVisiblePath();      validCachedPreferredSize = false;      tree.revalidate();      tree.repaint();    }