AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Re: getFocus setFocus

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java GUI Toolkits
View previous topic :: View next topic  
Author Message
Babu Kalakrishnan
Guest





PostPosted: Tue Jun 24, 2003 2:17 pm    Post subject: Re: getFocus setFocus Reply with quote



On Mon, 23 Jun 2003 13:08:28 GMT, Roedy Green <roedy (AT) mindprod (DOT) com> wrote:
Quote:
On Mon, 23 Jun 2003 13:41:08 +0100, Daniel Dyer
[email]dan.dyer (AT) dontspammeempathysoftware (DOT) com[/email]> wrote or quoted :

I believe these were some of the issues that were addressed in the focus
architecture rewrite in 1.4. I don't recall which methods were involved,
but the full details are at
http://java.sun.com/j2se/1.4.1/docs/api/java/awt/doc-files/FocusSpec.html.

On further digging I found transferFocus and hasFocus. However I
still have not found a method to tell you who has focus. You must poll
all possibilities with hasFocus.


Call getFocusOwner on all windows in your application.
(Frame.getFrames() followed by calling getOwnedWindows on each of them
recursively should get you a full list).

Only the active Window will return a non-null value for the
getFocusOwner call, and that is the component that has the focus
at that point in time.

BK

Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java GUI Toolkits All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.