Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / November 2003

Tip: Looking for answers? Try searching our database.

translate from screen coordinate to component?

Thread view: 
brougham5@yahoo.com - 16 Nov 2003 22:21 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?

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!


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.