The way to bind a KeyStroke to a JComponent is with the components InputMap and ActionMap as shown in the
java tutorial.
The difficulty with this is that as long as the focus is on/in a JTextField the JTextField will consume the keystroke. The "enter" keystoke, ie, typing "enter", generates an ActionEvent in a JTextField. So one way to work with this might be to set an Action (as shown below) or add an ActionListener to the JTextField to do the copy behavior.
You can still register the "enter" keystroke on the
copy button but to use it you must navigate through/past the JTextFields to the button with the tab key and then press the enter key. Seems like more work than the mnemonic option.
[ July 30, 2004: Message edited by: Craig Wood ]