title: How to validate a JTextField of email ID with a regex in swing code?
body: <p>I have tried a lot for this validation but I'm not getting where to put the following code</p>
  
  <pre><code>String expression="^[\\w\\-]([\\.\\w])+[\\w]+@([\\w\\-]+\\.)+[A-Z]{2,4}$";.
  </code></pre>
  
  <p>Please help me in this.</p>