• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how I can implement enter as tab functionality? when someone pressed enter focus goes to next widget

 
raminaa niilian
Ranch Hand
Posts: 551
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Can you please let me know how I can implement Enter as Tab feature, for example in a form with 10 different JTextbox, I want to make it possible to my users to hit the enter when they finished typing content of one JTextbox and g to next JTextbox. Enter should work as TAB.

Thanks
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> Enter should work as TAB.

needs modification if you do not want tab to also work

 
Bikash Megale
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for example in a form with 10 different JTextbox, I want to make it possible to my users to hit the enter when they finished typing content of one JTextbox and g to next JTextbox. Enter should work as TAB.




you can use keyListener if enter key pressed then you can move focus to the desirable component by using requestFocus();



 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic