File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Swing / AWT / SWT
Joined: Jan 26, 2006
Apr 05, 2009 21:49:07
i have few textfields on my frame. I want to know the textfield name which is currently focused. can someone please help me. How to know the current focused object name.
Joined: Jun 09, 2003
Apr 05, 2009 21:57:14
this will give you the focus owner
Component currentFocusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
Component has a getName(), but you would be responsible for setting the name
I agree. Here's the link:
subject: Focuse object
* Welcome Larry Aronson
Oracle Certification Site Similar to Javaranch
Prototype and JQuery
xml certificate kinds
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015