0
votes

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

2 Answers

4
votes

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
votes

use filter for this.....

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