Article View: borland.public.jbuilder.java.language
Article #17194Re: Find out which componet currently has focus
From: Franck Rasolo
Date: Thu, 10 Dec 1998 00:00
Date: Thu, 10 Dec 1998 00:00
43 lines
1777 bytes
1777 bytes
Michael,
I think this what you're looking for, it's taken from the Swing (1.0.3)
API documentation :-
Class com.sun.java.swing.SwingUtilities
(...)
public static java.awt.Component findFocusOwner(java.awt.Component c)
Return the child component which has focus, if any. The HotJava
SecurityManager forbids applet access to getFocusOwner(), so if the
component is an applet, we check whether a JComponent has focus.
Non-Swing components in an applet on HotJava are out-of-luck,
unfortunately.
(...)
Good luck with Focus management !
Franck
Michael Nguyen wrote:
>
> Is there an API that returns either awt.Component or JComponent
> to indicate it is the component that currently has focus ?
> Thanks for the info.
>
> Michael Nguyen,
--
_________________________________________________________________
Franck Rasolo
Netspin Ltd Phone: +44 (0)958 750 712
7 Hill Street Fax : +44 (0)117 925 2515
Bristol BS1 5PU Email: franck@netspin.co.uk
U.K. URL : http://www.cs.bris.ac.uk/~rasolono/
_________________________________________________________________
Technical Details
Message-ID:
<366F5C69.822788A4@netspin.co.uk>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<366F0DF0.BEA9EA48@home.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,a5fd9d561ea8c109 X-Google-Attributes: gidf74b3,public From: Franck Rasolo <franck@netspin.co.uk> Subject: Re: Find out which componet currently has focus Date: 1998/12/10 Message-ID: <366F5C69.822788A4@netspin.co.uk> X-Deja-AN: 420702475 Content-Transfer-Encoding: 7bit References: <366F0DF0.BEA9EA48@home.com> To: Michael Nguyen <michaelmn@home.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: Netspin Limited Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language