0

I want to create the EditField which allow Numeric Values, Comma and other values are ignore in Blackberry.

So How I can achieve this by programming code ?

Thanks.

2 Answers 2

4

It can be achieved by using the EditField class with the Four arguments according to your need.

        EditField ef = new EditField(0, "0", 3, EditField.FILTER_NUMERIC)

Add this field to a screen or a manager

The above code would make the field accept only the integer values. And if it is a Virtual keypad, it would not even show other characters/aplhabets on the keypad

Hope this solves your problem. Keep Coding Cheers !!

1

use filter for this.....

_numberEditField = new EditField(_name, "");
_numberEditField.setFilter(TextFilter.get(TextFilter.NUMERIC));
add(_numberEditField);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.