title: make enter key act like a tab key for jtextfield,jcombobox,jspinner in java
body: <p>I want enter key to behave like tab key in my swing application.And this class is working fine for JTextFields.How can i do the same for JComboBox and Jspinner or for the other controls on the frame?kindly help.</p>
  
  <pre><code>class MyTextField extends JTextField {
      MyTextField(int len) {
      super(len);
      addKeyListener(new KeyAdapter() {
              @Override
        public void keyPressed(KeyEvent evt) {
          int key = evt.getKeyCode();
          if (key == KeyEvent.VK_ENTER)
            transferFocus();
        }
      });
    }
  }
  </code></pre>