title: JTextField's real time formatting of user input
body: <p>I would like to format the user input in real time, while they are typing.</p>
  
  <p>For example, if I want the user to enter a date, I would like the text field to show in light gray the date format. The user would only be able to enter valid digits while he is typing.</p>
  
  <p>If I need the user to enter a phone number, the format would be displayed in light gray in the text field and the user would only be able to enter valid digits...</p>
  
  <p>A javascript example of this can be found here:
  <a href="http://omarshammas.github.io/formancejs#dd_mm_yyyy" rel="nofollow">http://omarshammas.github.io/formancejs#dd_mm_yyyy</a></p>
  
  <p>I looked at JFormattedTextField but it seems it doesn't prevent the user from typing wrong characters. </p>
  
  <p>I am wondering how to do the same thing in Java as the javascript code linked above.</p>
  
  <p>Any idea to help me get started or any lib already doing this?</p>
  
  <p>Thanks in advance for any suggestion.</p>