swan
Posts: 7
Nickname: swan
Registered: Aug, 2003
|
|
Re: setting Focus
|
Posted: Aug 27, 2003 8:27 PM
|
|
If you are using a JTextField (you have mentioned JTextBox), you can use the JTextField's requestFocus() method.
requestFocus() requests that this Component get the input focus, and that this Component's top-level ancestor become the focused Window. This component must be displayable, visible, and focusable for the request to be granted.
You must never assume that this Component is the focus owner until this Component receives a FOCUS_GAINED event.
If this request is denied because this Component's top-level Window cannot become the focused Window, the request will be remembered and will be granted when the Window is later focused by the user.
|
|