public static Object getNodeAt(final JTree tree, final int x, final int y) {
    final TreePath selPath = tree.getPathForLocation(x, y);
    return selPath != null ? selPath.getLastPathComponent() : null;
  }
Finds the node at a given mouse cursor position.

@param tree The tree where the node is located.
@param x The x coordinate of the mouse position.
@param y The y coordinate of the mouse position.
@return The node at the given cursor position or null if there is no node at that position.
java/zylib/src/main/java/com/google/security/zynamics/zylib/gui/jtree/TreeHelpers.java