Link to home
Start Free TrialLog in
Avatar of holster21
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.
ASKER CERTIFIED SOLUTION
Avatar of gageot
gageot

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gageot
gageot

Sorry for the tabulation...
use something like this:

component.registerKeyboardAction(listener, "_Enter", KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0, false),
            JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
Avatar of holster21

ASKER

The first response was excellent! :)  You have made my day...