In my applcation I have a JText field for entering a phone number.
Is it possible to make it only accept numerical characters? Or should i wite a method to alert the user if they enter any other characters into it?
Jump to Post
Have a look at the API doc for JTextField. The intro shows how to create a custom field - in that example one that takes upper-case letters only. You should be able to use that example and its accompanying explanation to create your own numeric-only field.
Alternatively, if you have …
All 3 RepliesReply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.