Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: How only input numbers,decimal and negative????

I suspect if you are doing this in the Constructor you need to say

this.set...

 

This code works for me:

BasicEditField test = new BasicEditField("Test Input: ", "12345");
test.setFilter(new NumericTextFilter(NumericTextFilter.ALLOW_DECIMAL | NumericTextFilter.ALLOW_NEGATIVE));

Highlighted
Contributor
Posts: 25
Registered: ‎02-15-2012
My Device: Storm
My Carrier: Vodacom

Re: How only input numbers,decimal and negative????

Thanks! The code is perfect! The problem was that my emulator wasnt updating when I changed the code Smiley Embarassed