Click to See Complete Forum and Search --> : input masking


sah
December 26th, 2008, 01:07 AM
suppose a text field takes phone number as input. i want to make the text field take only digits and if any letter is pressed then no character is echoed in the text field. how can i do this?

dlorde
December 26th, 2008, 07:31 AM
See JFormattedTextField (http://java.sun.com/javase/6/docs/api/javax/swing/JFormattedTextField.html) and How to Use Formatted Text Fields (http://java.sun.com/docs/books/tutorial/uiswing/components/formattedtextfield.html).

We are faced with an insurmountable opportunity...
W. Kelley