views:

267

answers:

1

I need to transfer focus onto another element when user press Enter key, so I succeded to register KeyStroke on most elements this way:

 this.getInputMap( ).put( KeyStroke.getKeyStroke( '\n' ), "transferFokus" );

  this.getActionMap( ).put( "transferFokus", transferFokusa );

everything works fine except for my class which extends JXDatePicker which I suppose consumes Enter key inside. What can I do?

The whole point is to ease people using GUI interface, since they've worked on old DOS application in which they where moving inside form with Enter instead of TAB key.

A: 

From the javadoc it looks like JXDatePicker uses a JFormattedTextField for the actual editing component for the date string. JXDatePicker.getEditor() returns the text field so maybe you should try calling getInputMap() and getActionMap() on the text field?

Mark
yep... this seems to be working, thanks a lot!
ante.sabo