title: Pressing Enter to Continue
body: <p>I have a JDialog which has two fields, username and password. I want to make the form like normal ones in which pressing enter will be like pressing continue. </p>
  
  <p>I have already tried <code>getRootPane().setDefaultButton(myButton);</code>, but only that does not seem to work. </p>