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 to detect when the application loses or takes focus



Thanks Greg,

You recall correctly about getOppositeWindow() having bugs. I raised it on the list a while ago and a few of us had encountered the same problem. I think its fixed now leaving the door open for identifying whether the application has gained/lost focus.

I'll move forward with this strategy in the absence of another way forward.

Cheers,

Ian Cheyne

On 16 Aug 2005, at 19:13, Greg Guerin wrote:

Ian Cheyne wrote:


Is the best way to just watch for WindowEvents and (using
getOppositeWindow()) establish that if the oppositeWindow is null that the
application is either losing or taking focus. I'm using and targetting
Java 1.4.2.



I vaguely recall a bug with getOppositeWindow(), but I can't recall if it
was null when it shouldn't have been, or was non-null when it should have
been. Try searching the archives.


Or is there a better/easier way?


The javadocs for getOppositeWindow() describe the switch between applications as returning an opposite window of null, confirming your proposed strategy (modulo any bugs, and qualified by event-type).

  -- GG


_______________________________________________ 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


_______________________________________________ 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
References: 
 >Re: How to detect when the application loses or takes focus (From: Greg Guerin <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.