Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How can I get mouse positions on desktop when my frame isrunning



Hi Doug Zwick,

Although you can't easily capture mouse events on the desktop from Java, if you know these events are coming (e.g. you have a button/menu item for "capture desktop image" or "make screen snapshot" or some such thing), you could create a transparent, undecorated, always-on- top JFrame at the full size of the display, and capture mouse events on it. Once you have your events, you can close and dispose the JFrame. Such a frame would also give you a place to draw your drag effects.

Thanks for your valuable suggestion. I tried the above approach. Everything is working fine with one exception. The only problem with this approach is, the frame inside which I am showing the captured image is not coming on top of MAC Menubar. I tried by changing the frame location to match the captured image positions exactly with the MAC Menu bar, but found that the frame is going behind the MAC Menu bar. Due to this, there is a chance that user can perform some other activities before actually generating the desired mouse events.
Is there any way to solve this issue?


Regards,
Vijay

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.