Catching Mouse Event (NEW CONCEPT -URGENT)
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Imran_Masud
Posted On:   Wednesday, June 20, 2001 09:41 PM

In java, I have seen, mouse events are only triggered if we move mouse inside a container. But is it possible to catch a mouse event when mouse is not on our container?
Example:
- My java program is running.
- I open notepad and drag mouse
- Is it possible to send the event to my java program that mouse is dragged.
---------------------------------------
I will really appreciate if any one can answer my question.
Regards
Imran

Re: Catching Mouse Event (NEW CONCEPT -URGENT)

Posted By:   daniel_walker  
Posted On:   Thursday, June 21, 2001 10:09 PM

You can track mouse events outside the container.

You'll need to get the default AWT toolkit and addAWTEventListener to add a Mouse Event Listener to it.


If you're trying to drag data out of 'notepad' check out the awt.dnd package.


If you're trying to copy/paste data from/to 'notepad' why not use the clipboard (see Toolkit.getSystemClipboard().


Hope this helps.


Dan

Re: Catching Mouse Event (NEW CONCEPT -URGENT)

Posted By:   Michael_Wax  
Posted On:   Thursday, June 21, 2001 04:32 PM

This doesn't seem like something that you can do, and I believe that the operating system (not Java) is what is stopping you. For example, in Windows, I don't believe that Outlook can generate a mouse dragged event when the mouse is being dragged over Excel.
About | Sitemap | Contact