devxlogo

Textfield focus

Textfield focus

Question:
I have a frame with a few textfields on it. How can I set the focus to the first textfield? Is there something like setFocus?

Answer:
A component can obtain the input focus by invoking requestFocus(), which is defined in java.awt.Component.

devx-admin

Share the Post: