suppose there are two textbox and we want to find which textbox has got foucus currently?
Michael Dunn
Ranch Hand
Joined: Jun 09, 2003
Posts: 4632
posted
0
there are a number of ways
check the textfields to see if either currently has the focus if(textField1.isFocusOwner())... else if(textField2.isFocusOwner())...
check the focusManager to get the focused component, Component currentFocusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();