aspose file tools
The moose likes Swing / AWT / SWT and the fly likes How to make text field to accept only alphabets Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply locked New topic
Author

How to make text field to accept only alphabets

Shrikanth Nekkanti
Ranch Hand

Joined: Jul 12, 2007
Posts: 48
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.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35221
    
    7
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.


Android appsImageJ pluginsJava web charts
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Closing this duplicate post. Please continue discussion in the other thread.


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: How to make text field to accept only alphabets
 
Similar Threads
how to make text field to accept only alphabets
Validate textbox to accept only numeric values.
Amout validation
How to make text field to accept only alphabets.
javascript regular expression related problem.