tree.removeMouseListener(mouseInputListener);
tree.removeMouseListener(mouseListener);
  public void uninstallUI(JComponent c)  {    tree.setFont(null);    tree.setForeground(null);    tree.setBackground(null);        uninstallKeyboardActions();        tree.removePropertyChangeListener(propertyChangeListener);    tree.removeFocusListener(focusListener);    tree.removeTreeSelectionListener(treeSelectionListener);    tree.removeMouseListener(mouseInputListener);    tree.removeKeyListener(keyListener);    tree.removePropertyChangeListener(selectionModelPropertyChangeListener);    tree.removeComponentListener(componentListener);    tree.removeTreeExpansionListener(treeExpansionListener);    TreeCellEditor tce = tree.getCellEditor();    if (tce != null)      tce.removeCellEditorListener(cellEditorListener);    TreeModel tm = tree.getModel();    if (tm != null)      tm.removeTreeModelListener(treeModelListener);        tree = null;    uninstallComponents();    completeUIUninstall();  }