wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes how I can implement enter as tab functionality? when someone pressed enter focus goes to next widget Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "how I can implement enter as tab functionality? when someone pressed enter focus goes to next widget" Watch "how I can implement enter as tab functionality? when someone pressed enter focus goes to next widget" New topic
Author

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

raminaa niilian
Ranch Hand

Joined: Jul 14, 2005
Posts: 551
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

Joined: Jun 09, 2003
Posts: 4632
> Enter should work as TAB.

needs modification if you do not want tab to also work

Bikash Megale
Greenhorn

Joined: Jan 01, 2007
Posts: 6
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();



 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how I can implement enter as tab functionality? when someone pressed enter focus goes to next widget
 
Similar Threads
disable OK button in JOptionPane when input is null
BETA Properties file
text typing in jTextBox
JTable - Enter instead of Tab
Pressing Tab enter JTable, pressing Tab again exit JTable