How will we find that the cursor is now in that text field? I have two text fields in Java. I want to write text in a text field but before writing text I want to check which text field is selected. How can I check it?
You can use isFocusOwner():
if(textField.isFocusOwner()) {
// the cursor is in the TextField
}