I am creating a custom text field for my application by extending RichTextField, I am passing the text I need to the constructor and adding that object where ever it is needed. My application is a news paper application has around 20-30 size list in few pages and description pages and some pages has 100-200 list, can this method of creating text slow down my application? Is there any better other method for creating customtext??
public class CustTextField extends RichTextField{
private String _text;
private FontFamily _fontFamily1;
private int _size, _color;
private Font _headFont = null;
public CustTextField(String _text, int _size,int _color, long _property)
{
super(_text, _property);
FontFamily _fontFamily1;
this._color = _color;
try{
_fontFamily1 = FontFamily.forName("aerial");
} catch(ClassNotFoundException e) {
_fontFamily1 = Font.getDefault().getFontFamily();
}
_headFont = _fontFamily1.getFont(Font.PLAIN,_size);
super.setFont(_headFont);
}
protected void paint(net.rim.device.api.ui.Graphics g) {
g.setColor(_color);
super.paint(g);
}
}
I am using the above code for the customtextfield.