• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 254
  • Last Modified:

specific textField for int and floats

hi boys...

my question is that how can i specify a textfield for entering just int values or just float values or just Strings??

using java application can anyone give me an example code to help me.

NOTE: not using java swing.

thanks guys.
1 Solution
I did it once and it went somethig like it:

Study every character that is inserted on the textfiel. There must be a JAVA routine for that.

For STRINGS, let it run free...

For INTEGERS, let only numbers be entered. If an "A" is entered, make Length(TEXT)=Length(TEXT)-1, e.g: Turn "123A" into "123" and write it on textfield.

For real numbers, let only 1 'point' be entered.
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Post your closing recommendations!  No comment means you don't care.

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now