holster21
asked on
Using enter key to traverse fields
We would like to traverse through fields using the enter key. Could you please give us an example on how to do this. If I understand the javadoc stuff, I believe I need to register actions for when an enter key is pressed.
Is there an example I could look at?
Thanks.
Is there an example I could look at?
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Sorry for the tabulation...
use something like this:
component.registerKeyboard Action(lis tener, "_Enter", KeyStroke.getKeyStroke(Key Event.VK_E NTER, 0, false),
JComponent.WHEN_ANCESTOR_O F_FOCUSED_ COMPONENT) ;
component.registerKeyboard
JComponent.WHEN_ANCESTOR_O
ASKER
The first response was excellent! :) You have made my day...