else if (property.equals(JTree.SELECTION_MODEL_PROPERTY)) { treeSelectionModel = tree.getSelectionModel(); treeSelectionModel.setRowMapper(treeState); } else if (property.equals(JTree.TREE_MODEL_PROPERTY)) { treeModel = tree.getModel(); treeModel.addTreeModelListener(treeModelListener); }
    public void propertyChange(PropertyChangeEvent event)    {      if ((event.getPropertyName()).equals("rootVisible"))        {          validCachedPreferredSize = false;          treeState.setRootVisible(tree.isRootVisible());          tree.repaint();        }    }