I'm programming an interface with several JTextFields, and some error checking once the user hits submit. IT goes through each text field, and if it detects a problem it returns to the form so the user can make the necessary corrections. The problem is that I want the cursor to be in the correct TextField. I've got something along the lines of:
but no cursor seems to be placed into the textfield. My guess is there must be an activateTextfield() function or something, but I can't find anything of the kind in the documentation. Does anyone know how to do this?
requestFocus
publicvoid requestFocus()
Requests that this component get the input focus. The component must be visible on the screen forthis request to be granted
Since:
JDK1.0