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?
Thanks
GlenRogers 0 Newbie Poster
Recommended Answers
Jump to Postanother possibility is by adding an implementation of the KeyListener interface to your textfield. there are several ways of doing what you're trying to do, just look at your application, whether you need it once, twice, a lot of times, in one java class, in several java classes, ...
All 3 Replies
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
stultuske 1,116 Posting Maven Featured Poster
GlenRogers 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.