hi, Im just a newbie in java, I really want to learn but sometimes I lost my guts to learn coz Im always stuck on something, for example in JTextField UI, I want the UI to accept just a numeric input and prompt the user when the input is not a numeric type and also it will not display on the UI. Can somebody give a hint on how to flush the unnumeric key and I will do the rest, Id tried the InputVerifier class but still it accept and display the unnumeric key...Thanks
choybutchoy
0
Newbie Poster
Recommended Answers
Jump to PostThis depends on how the user is indicating that they are done filling out the JTextField. Are they clicking a button? Is an event fired when the key is pressed? Since you didn't say I'll assume the user is clicking a button once they put their input in the text …
Jump to PostThis should help you out:
http://www.devx.com/tips/Tip/14510Just add a pop-up message when the if evaluates to false, and you're good to go!
Good luck
All 8 Replies
BestJewSinceJC
700
Posting Maven
di2daer
12
Junior Poster in Training
BestJewSinceJC
700
Posting Maven
di2daer
12
Junior Poster in Training
kvprajapati
1,826
Posting Genius
Team Colleague
choybutchoy
0
Newbie Poster
kvprajapati
1,826
Posting Genius
Team Colleague
choybutchoy
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.