Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.gui > #267
| From | "James Appleby" <james.appleby@THRWHITE.remove-dii-this> |
|---|---|
| Subject | Listening to Mouse leavin |
| Message-ID | <1164883540.536184.161880@j72g2000cwa.googlegroups.com> (permalink) |
| Newsgroups | comp.lang.java.gui |
| Date | 2011-04-27 15:26 +0000 |
| Organization | TDS.net |
To: comp.lang.java.gui Hello, I'm having difficulties implementing a requirement for an application I'm writing and I'm hoping someone can help. I have a JFrame that sits on top of the desktop and has various input fields in it. The requirement is that when the user leaves the frame to use other applications the data is submitted for processing. I have tried to implement this using a MouseListener. (I know it would miss Alt-Tab or other none mouse navigation but I felt it worked for my user group.) The problem is that adding a listener on the main frame fired off an event for it and every component added to it. So if I move the mouse across the frame, into and out of a text field without clicking, I get two events, one when it exits the frame into the text field and another exiting the text field back to the frame. Solving the second half was easy, as I knew the only component I wanted to track, I gave a reference of the main frame to the listener. However it still fires off an event every time I leave the frame for an internal compoent, while I only want to track the point it leaves the outer bounds of the main frame. I have been stuck on this for quite a while and searched extensively for a solution. Can anyone help me, please? Is there a way of getting an event triggered only when leaving the outer edge of a frame, either using the MouseListener or another means. All help will be greatly appreciated. James --- * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet! --- Synchronet 3.15a-Win32 NewsLink 1.92 Time Warp of the Future BBS - telnet://time.synchro.net:24
Back to comp.lang.java.gui | Previous | Next — Next in thread | Find similar
Listening to Mouse leavin "James Appleby" <james.appleby@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
Re: Listening to Mouse le "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
Re: Listening to Mouse le "Thomas Kellerer" <thomas.kellerer@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
Re: Listening to Mouse le "James Appleby" <james.appleby@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
Re: Listening to Mouse le "Oliver Wong" <oliver.wong@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
Re: Listening to Mouse le "James Appleby" <james.appleby@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
csiph-web