Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting focus on first field on Form load

 
bhuwan tiwari
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
As usual i wish to set my focus to first field of the form.
But by default it goes to the last component added.
i tried the method:
requestDefaultFocus()
requestFocus()
grabFocus()
but none of them is working when first time form is created.
plz suggest the way.
bhuwan
 
Helmut Lerch
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hy,
Originally posted by bhuwan tiwari:
i tried the method:
requestDefaultFocus()
requestFocus()
grabFocus()
but none of them is working when first time form is created.

as far as I know you have to call this method after the container is visible.


[This message has been edited by Helmut Lerch (edited July 09, 2001).]
 
Harry Pfohl
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
get first component of the panel and call seFocus(true) on it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic