@fbarros you can implement the Document and setar interface in Jtextfield.
I suggest you extend the class javax.swing.Plaindocument, then overwrite the method insertString(int offs, String str, Attributeset a).
In this method, treat String str. String str is what you should treat which characters are accepted or not. Its value is what is being entered into Jtextfield before it is even displayed.
At this link (+ that) you can find some examples of how to create a Document for Jtextfield with entry restrictions.
Note: You may have to overwrite the remove(int offset, int length) method as well;
Take a look http://answall.com/questions/41083/m%C3%A1scara-Monet%C3%A1ria-para-jtextfield
– Marcelo T. Cortes
You are using which IDE?
– DiegoAugusto