permaculture playing cards*
The moose likes Beginning Java and the fly likes accepting only numbers in a text field Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "accepting only numbers in a text field" Watch "accepting only numbers in a text field" New topic
Author

accepting only numbers in a text field

vinod kumar
Greenhorn

Joined: Jan 24, 2005
Posts: 15
hai all
I want a text field(jformattedtextfield) which accepts only numbers.It should not even display the other characters.That is here i am not interested in focus listener.Is there any method by which on enter(key press) itself the validation can be done so that other nonintegers are not typed(not accepted by the text field).
Vijay Vaddem
Ranch Hand

Joined: Feb 13, 2004
Posts: 243
Check this....
vinod kumar
Greenhorn

Joined: Jan 24, 2005
Posts: 15
thank u
it is working now.....
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: accepting only numbers in a text field
 
Similar Threads
text field
NX: null terminated if less than the maximum length for the field
Cant able to get focus at perticular textfield in javascript
Only Numeric value allowed
Jtextfield