Forums Register Login

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

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
> Enter should work as TAB.

needs modification if you do not want tab to also work

+Pie Number of slices to send: Send
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();



Please do not shoot the fish in this barrel. But you can shoot at this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 2185 times.
Similar Threads
BETA Properties file
disable OK button in JOptionPane when input is null
Pressing Tab enter JTable, pressing Tab again exit JTable
JTable - Enter instead of Tab
text typing in jTextBox
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 05:44:44.