title: How to check whether a Birth Date entered is valid
body: <p>A user enters his birth date in a jTextfield in the yyyy/mm/dd and I want to make sure that he enters it correctly like that and also that it is a real date. this is my code so far:</p>
  
  <pre><code>SimpleDateFormat df = new SimpleDateFormat("yyyy/mm/dd");  
  Date testDate = null;
  
  Birth = jTextField3.getText();
  
  try{  
      testDate = df.parse(Birth);
  } catch (ParseException e){ }      
  if (!df.format(testDate).equals(Birth)){  
      JOptionPane.showMessageDialog(rootPane, "invalid date!!");
  }
  </code></pre>
  
  <p>the error I am getting is it said I cant cast a <code>java.sql.Date</code> into a <code>java.util.Date</code></p>