1

Possible Duplicate:
jTextField accept only alphabet and white space

Ey! i have a Custom JTextField (extends from JTextField) , this CustomJTextField ,mainly has the JtextField Methods in Spanish like setFont Renamed to SetFuente,

In this Custom JTextField ,i need to create a method that validates that the only values that can be written are Alphanumeric and (.) dot , so if i write (,) or (*) the symbol doesn't appear on the JTextField, something like CustomJTextField.setFormat(ALPHA).

i didnt find the Swing library that can help me with this, any suggestion is weel received

thx!

Community
  • 1
  • 1
  • Also see [this](http://stackoverflow.com/questions/14305921/detecting-jtextfield-deselect-event/14305952#14305952) similar question/answer. Which shows the various native java ways to verify/filter input to text components. – David Kroukamp Jan 31 '13 at 20:41
  • Also you can override replaceSelection method of JTextField, but the other options are better. – Sergiy Medvynskyy Jan 31 '13 at 21:28
  • sry im new on forum and i had no idea about this components .im now tryng to use a DocumentFilter , that uses the characters from a Hashmap and only let me write the characters contained in the HashMap – user2030181 Feb 11 '13 at 04:14

0 Answers0