This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Regarding Focus  RSS feed

 
adeeb alexander
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have few textfields and a submit Jbutton. But when i want to press the button i should bring the focus on it by using the mouse or the TAB key.
My need is that when i fill the fields and press the enter key the button should be pressed.
Can any body please help me regarding this.

Thanks & Regards In Advance
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> ...and press the enter key the button should be pressed.

frame.getRootPane().setDefaultButton(button);
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!