 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Babu Kalakrishnan Guest
|
Posted: Tue Jun 24, 2003 2:17 pm Post subject: Re: getFocus setFocus |
|
|
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 |
|
 |
|
|
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
|
|