I'm trying to figure out which node my mouse cursor is over when my
DragSourceListener gets a DragSourceDragEvent. I can get the location from
the event, but how do I translate that coordinate into one I can use in
JTree's getPathForLocation method?
I've searched past usenet articles, but I appear not to know the magic words
to use. I'm not finding anything that tells me how to do this. Surely, I
don't have to get all the individual offsets myself and add them up!
Max - 17 Nov 2003 00:39 GMT
> I'm trying to figure out which node my mouse cursor is over when my
> DragSourceListener gets a DragSourceDragEvent. I can get the location from
> the event, but how do I translate that coordinate into one I can use in
> JTree's getPathForLocation method?
SwingUtilities.convertPointFromScreen(Point p, Component c)

Signature
Regards /max (rotvel AT mail DOT dk)
brougham5@yahoo.com - 17 Nov 2003 11:35 GMT
>SwingUtilities.convertPointFromScreen(Point p, Component c)
That is exactly what I need. Thanks!