if (tree != null && tree.isEnabled())
if (! e.isConsumed()) { handleEvent(e); selectedOnPress = true; } else
    public void mousePressed(MouseEvent e)    {      if (tree != null && tree.isEnabled())        {          // Maybe stop editing and return.          if (isEditing(tree) && tree.getInvokesStopCellEditing()              && !stopEditing(tree))            return;                int x = e.getX();          int y = e.getY();          TreePath path = getClosestPathForLocation(tree, x, y);      if (path != null)        {          Rectangle bounds = getPathBounds(tree, path);              if (SwingUtilities.isLeftMouseButton(e))                checkForClickInExpandControl(path, x, y);                        if (x > bounds.x && x <= (bounds.x + bounds.width))                    {                  if (! startEditing(path, e))                        selectPathForEvent(path, e);                }                }        }    }