File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Swing / AWT / SWT
How to make text field to accept only alphabets
Joined: Jul 12, 2007
Sep 25, 2007 23:36:00
I have a First name Text field.I want to make this text field to accept only characters.
How to make this text field to restrict accepting numbers and special characters.
Joined: Mar 22, 2005
Sep 25, 2007 23:59:00
Assuming you're talking about a Swing application, have a look at
this code example
. It shows how to allow digits only. From that it should be easy to adapt it to your purposes.
Ping & DNS, my free Android app for network diagnostics
Joined: Oct 18, 2000
Sep 26, 2007 07:04:00
Closing this duplicate post. Please continue discussion in the
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
I agree. Here's the link:
subject: How to make text field to accept only alphabets
How to make text field to accept only alphabets.
how to make text field to accept only alphabets
Validate textbox to accept only numeric values.
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013