I implemented drag and drop in my JTree and it works, but I find this a bit confusing. In the picture, I show how the drag location between item4 and item5 can vary depending on how far between the nodes you are. I guess this is because the line borders for item4 and item5 meet in the middle between them, and depending on which side you are on, you are actually on another line.
From the user's point of view, I think this is not natural. I would think that if I go down above the node, the fall will happen over it. If I went below the node, a drop will occur under it. Is there a way to customize this behavior?

EDIT: adding code to show how to get a place to delete
DropLocation dropLoc = support.getDropLocation(); Point dropPoint = dropLoc.getDropPoint(); tree.getTree().getPathForLocation(dropPoint.x, dropPoint.y);
Please note that support is a TransferSupport object
EDIT 2: I seem to have solved this problem by checking if the drop point is above or below half of the node point. Then I can determine if the drop was higher or lower than the node.
source share