Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

regarding FocusEvent  RSS feed

 
Jignesh Gohel
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

When i click on a button(for e.g 'Next') then a new page is opened with some components like textfields.Now when i click on Next then the focus should get on the first textfield so how can i do it??

Thanking you,
Jignesh
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
firstTextfield must be visible (programatically, not necessarily visually) then

firstTextfield.requestFocusInWindow()
 
Jignesh Gohel
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply.

Actually the page which is being opened is a JTabbedPane in which the textfield is there on which i want to get focus.I tried ur idea previously ,but it didn't worked.

So if there other option is there then please let me know.........

Thanking you,
Jignesh
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
works OK in this, using java 1.4.0_01

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!