title: Set keyboard shortcut for a JButton?
body: <p>I have a type game in which you have to type the words that appear as fast as possible before the time limit runs out, but every time you type a word, you must move the mouse and click enter and click back into the user input to type the next word.  I was just hoping if there was way to use "keyCode.VK_Enter" to issue an Action Command called by the JButton.</p>
  
  <p>Some snippets of my code:</p>
  
  <p>The Enter button and user input and output:</p>
  
  <pre><code>enter = new JButton("Enter");
      enter.setFont(serif);  //serif is specified earlier
      enter.setActionCommand("Enter");
      enter.addActionListener(this);
      container.add(enter);
  
  userOutput = new JTextField(50);
      userOutput.setFont(serif);
      container.add(userOutput);
      userOutput.setEditable(false);
  
  userInput = new JTextField(43);
      userInput.setFont(serif);
      container.add(userInput);
      userInput.setEditable(false);
  </code></pre>
  
  <p>The actionPerformed method getting the enter button's action command:</p>
  
  <pre><code>if(userInput.getText().equals(userOutput.getText())){
              userInput.setText("");
              score += 100;
  </code></pre>