• Post Reply Bookmark Topic Watch Topic
  • New Topic

Validate textbox to accept only numeric values.  RSS feed

 
Poornima Rao
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm new to java and would like to know how to validate a text field to accept only numeric values.
 
Rob Spoor
Sheriff
Posts: 20903
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please SearchFirst. This question has come up quite a few times already.

Easiest way: use a JSpinner. The user can type in it, but also use the up-down buttons.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!