I have a few TextFields in my Frame. I want to know which TextField currently has focus. How can I find this information?
Every JComponent has a hasFocus method that you can use to check if it has focus. However, this has been changed, and now you should use isFocusOwner.
So run over all the text fields in your frame, and check on each of them if it is isFocusOwner by calling that method.
You could also get the focus owner through the frame.