Results 1 to 3 of 3
Thread: Last focused component
- 11-21-2009, 06:03 AM #1
Member
- Join Date
- Aug 2007
- Posts
- 40
- Rep Power
- 0
Last focused component
If FocusTravelPolicy transfer focus in order jc1,jc2,jc3,jc4,jc5 (These are swing components in a JFrame). My current focus is within jc2 and then I click on jc4 i.e. focus will be transfered to jc4 that can be obtained by
and we can get jc3 usingJava Code:KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner()
Now, I want to get jc2 because we receive focus on jc4 just after jc2.Java Code:KeyboardFocusManager.getCurrentKeyboardFocusManager().getDefaultFocusTraversalPolicy() .getLastComponentKeyboardFocusManager.getCurrentKeyboardFocusManager().getCurrentFocusCycleRoot())
My problem is that how to get last focused compoent?Last edited by Gajesh Tripathi; 11-21-2009 at 12:29 PM.
- 11-21-2009, 12:36 PM #2
Member
- Join Date
- Aug 2007
- Posts
- 40
- Rep Power
- 0
Waiting for Reply
Dear All,
Kindly solve my problem. I am very puzzled about it.
My Problem is Simple: How to get last focus owner component? e.g. we are at bttnSave (or else) and then click on a text field txtName. I want to get component that was owned focus before getting focus in text field.
So I hope, now you understand my problem.
Thanks In Advance
Gajesh T.
- 11-21-2009, 05:45 PM #3
Senior Member
- Join Date
- Aug 2009
- Location
- Pittsburgh, PA
- Posts
- 282
- Rep Power
- 4
Similar Threads
-
add component to component
By Omarero in forum New To JavaReplies: 7Last Post: 05-17-2009, 02:39 PM -
how to make window active and textfield focused
By whwillisiv in forum New To JavaReplies: 0Last Post: 04-28-2009, 04:06 AM -
Find Component by name
By amjad905 in forum Advanced JavaReplies: 9Last Post: 04-25-2009, 05:55 PM -
Same component on all JTabbedPane
By java_novice in forum AWT / SwingReplies: 4Last Post: 08-06-2007, 09:09 AM -
Help with custom component
By Falcon1 in forum AWT / SwingReplies: 8Last Post: 07-21-2007, 12:39 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks