Point click = e.getPoint(); TreePath path = getClosestPathForLocation(tree, click.x, click.y);  if (path != null) { bounds = getPathBounds(tree, path); int row = getRowForPath(tree, path); boolean cntlClick = isLocationInExpandControl(path, click.x, click.y);  boolean isLeaf = isLeaf(row);  TreeCellRenderer tcr = getCellRenderer(); Icon icon; if (isLeaf) icon = UIManager.getIcon("Tree.leafIcon"); else if (tree.isExpanded(path)) icon = UIManager.getIcon("Tree.openIcon"); else icon = UIManager.getIcon("Tree.closedIcon");  if (tcr instanceof DefaultTreeCellRenderer) { Icon tmp = ((DefaultTreeCellRenderer) tcr).getIcon(); if (tmp != null) icon = tmp; }   if (icon != null) bounds.width += icon.getIconWidth() + gap*2;  boolean inBounds = bounds.contains(click.x, click.y); if ((inBounds || cntlClick) && tree.isVisible(path)) { selectPath(tree, path); if (inBounds && e.getClickCount() == 2 && !isLeaf(row)) toggleExpandState(path);  if (cntlClick) { handleExpandControlClick(path, click.x, click.y); if (cellEditor != null) cellEditor.cancelCellEditing(); } else if (tree.isEditable()) startEditing(path, e); } }
    public void mousePressed(MouseEvent e)    {    }