tree = (JTree) c; configureLayoutCache();  UIDefaults defaults = UIManager.getLookAndFeelDefaults(); tree.setFont(defaults.getFont("Tree.font")); tree.setForeground(defaults.getColor("Tree.foreground")); tree.setBackground(defaults.getColor("Tree.background")); tree.setOpaque(true); tree.setScrollsOnExpand(defaults.getBoolean("Tree.scrollsOnExpand")); rightChildIndent = defaults.getInt("Tree.rightChildIndent"); leftChildIndent = defaults.getInt("Tree.leftChildIndent"); setRowHeight(defaults.getInt("Tree.rowHeight")); tree.setRowHeight(defaults.getInt("Tree.rowHeight")); tree.requestFocusInWindow(false);  setExpandedIcon(defaults.getIcon("Tree.expandedIcon")); setCollapsedIcon(defaults.getIcon("Tree.collapsedIcon"));  currentCellRenderer = createDefaultCellRenderer(); rendererPane = createCellRendererPane(); createdRenderer = true; setCellEditor(createDefaultCellEditor()); createdCellEditor = true; TreeModel mod = tree.getModel(); setModel(mod);  treeSelectionModel = tree.getSelectionModel(); drawingCache = new Hashtable(); nodeDimensions = createNodeDimensions();  propertyChangeListener = createPropertyChangeListener(); focusListener = createFocusListener(); treeSelectionListener = createTreeSelectionListener(); mouseListener = createMouseListener(); keyListener = createKeyListener(); selectionModelPropertyChangeListener = createSelectionModelPropertyChangeListener(); componentListener = createComponentListener(); cellEditorListener = createCellEditorListener(); treeExpansionListener = createTreeExpansionListener(); treeModelListener = createTreeModelListener();  editingRow = -1; lastSelectedRow = -1;  installKeyboardActions();  tree.addPropertyChangeListener(propertyChangeListener); tree.addFocusListener(focusListener); tree.addTreeSelectionListener(treeSelectionListener); tree.addMouseListener(mouseListener); tree.addKeyListener(keyListener); tree.addPropertyChangeListener(selectionModelPropertyChangeListener); tree.addComponentListener(componentListener); tree.addTreeExpansionListener(treeExpansionListener); if (treeModel != null) treeModel.addTreeModelListener(treeModelListener);  if (mod != null) { TreePath path = new TreePath(mod.getRoot()); if (!tree.isExpanded(path)) toggleExpandState(path); }  completeUIInstall();
super.installUI(c);
  public void installUI(JComponent c)  {    tree = (JTree) c;    configureLayoutCache();        UIDefaults defaults = UIManager.getLookAndFeelDefaults();    tree.setFont(defaults.getFont("Tree.font"));    tree.setForeground(defaults.getColor("Tree.foreground"));    tree.setBackground(defaults.getColor("Tree.background"));    tree.setOpaque(true);    tree.setScrollsOnExpand(defaults.getBoolean("Tree.scrollsOnExpand"));    rightChildIndent = defaults.getInt("Tree.rightChildIndent");    leftChildIndent = defaults.getInt("Tree.leftChildIndent");    setRowHeight(defaults.getInt("Tree.rowHeight"));    tree.setRowHeight(defaults.getInt("Tree.rowHeight"));    tree.requestFocusInWindow(false);        setExpandedIcon(defaults.getIcon("Tree.expandedIcon"));    setCollapsedIcon(defaults.getIcon("Tree.collapsedIcon"));        currentCellRenderer = createDefaultCellRenderer();    rendererPane = createCellRendererPane();    createdRenderer = true;    setCellEditor(createDefaultCellEditor());    createdCellEditor = true;    TreeModel mod = tree.getModel();    setModel(mod);    treeSelectionModel = tree.getSelectionModel();    drawingCache = new Hashtable();    nodeDimensions = createNodeDimensions();        propertyChangeListener = createPropertyChangeListener();    focusListener = createFocusListener();    treeSelectionListener = createTreeSelectionListener();    mouseListener = createMouseListener();    keyListener = createKeyListener();    selectionModelPropertyChangeListener = createSelectionModelPropertyChangeListener();    componentListener = createComponentListener();    cellEditorListener = createCellEditorListener();    treeExpansionListener = createTreeExpansionListener();    treeModelListener = createTreeModelListener();    editingRow = -1;    lastSelectedRow = -1;        installKeyboardActions();        tree.addPropertyChangeListener(propertyChangeListener);    tree.addFocusListener(focusListener);    tree.addTreeSelectionListener(treeSelectionListener);    tree.addMouseListener(mouseListener);    tree.addKeyListener(keyListener);    tree.addPropertyChangeListener(selectionModelPropertyChangeListener);    tree.addComponentListener(componentListener);    tree.addTreeExpansionListener(treeExpansionListener);    if (treeModel != null)      treeModel.addTreeModelListener(treeModelListener);        if (mod != null)      {        TreePath path = new TreePath(mod.getRoot());        if (!tree.isExpanded(path))          toggleExpandState(path);      }        completeUIInstall();  }