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
Highlighted
Contributor
Posts: 28
Registered: ‎02-18-2010
My Device: 8520
My Carrier: Movistar
Accepted Solution

Simple TextFilter problems.

Hello, I'm trying to do a numeric text filter on my RichTextField, this is my code:

 

RichTextField De = new RichTextField("",RichTextField.EDITABLE); De.setFilter(TextFilter.get(TextFilter.NUMERIC));

 

But I get 2 errors of the same type that say:

cannot find symbol
symbol  : variable TextFilter

 

Any help is appreciated, Thanks in advance.

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

Re: Simple TextFilter problems.

Try

 

RichTextField De = new RichTextField("",RichTextField.EDITABLE);

De.setFilter(new NumericTextFilter());

Contributor
Posts: 28
Registered: ‎02-18-2010
My Device: 8520
My Carrier: Movistar

Re: Simple TextFilter problems.

Thanks for helping but it didnt worked:

cannot find symbol
symbol  : class NumericTextFilter
location: class com.client.bberry.OpcionesScreen
         De.setFilter(new NumericTextFilter(NumericTextFilter.ALLOW_DECIMAL));

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

Re: Simple TextFilter problems.

[ Edited ]

Are you fairly new to Java?

 

Try adding an import statement for classes that the compiler can't find, like the followng:

 

import net.rim.device.api.ui.text.NumericTextFilter;

Contributor
Posts: 28
Registered: ‎02-18-2010
My Device: 8520
My Carrier: Movistar

Re: Simple TextFilter problems.

I knew I was missing something!

And yes I'm new to java, thanks for helping.