The Artima Developer Community
Sponsored Link

Java Answers Forum
setting Focus

1 reply on 1 page. Most recent reply: Aug 27, 2003 8:27 PM by swan

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
sabab

Posts: 34
Nickname: sabab
Registered: Aug, 2003

setting Focus Posted: Aug 27, 2003 10:19 AM
Reply to this message Reply
Advertisement
Hi
Anybody knows how to set focus on a JTextbox ?


swan

Posts: 7
Nickname: swan
Registered: Aug, 2003

Re: setting Focus Posted: Aug 27, 2003 8:27 PM
Reply to this message Reply
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.

Flat View: This topic has 1 reply on 1 page
Topic: Please Help! JRE 1.4.2 Uninstall Problem Previous Topic   Next Topic Topic: How and where the statement compiled

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use