title: How to validate an email from JTextField
body: <p>Just like the title says, I want to display a jOptionPane if there's a missing specific character in a jTextField. Let's say that character is "@".</p>
  
  <p>I tried something like this:</p>
  
  <pre><code>private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {   
     String email = (String)txtEmail.getText();
     if (!email.equals(email) &amp;&amp; email.equals("@")){
        jOptionPane1.showMessageDialog(null, "Please"); 
     }
  }
  </code></pre>
  
  <p>However, I can't get this to work.
  I also tried using <code>contains()</code> and <code>contentEquals()</code> but I don't know how to use it properly so I had changed the code. 
  Searching on Google also doesn't help because I can't find what I want.
  Please consider helping. BTW, I'm using netbeans.</p>