Here is a sample code which shows how to customize the LabelField in blackberry. This sample code is generic can be portable to any project. It accepts the String label, long style and also padding.
package com.sample.rim.ui.uicontrols; import net.rim.device.api.ui.Graphics; import net.rim.device.api.ui.XYEdges; import net.rim.device.api.ui.component.LabelField; public class CustomLabelField extends LabelField { public CustomLabelField(Object text, long style) { super(text, style); } public CustomLabelField(Object text, long style, XYEdges padding) { super(text, style); this.setPadding(2,5, 2, 5); this.setPadding(padding); } private int mFontColor = -1; public void setFontColor(int fontColor) { mFontColor = fontColor; } protected void layout(int width, int height) { super.layout(width, getPreferredHeight()+5); setExtent(width, getPreferredHeight()+5); } protected void paint(Graphics graphics) { if (-1 != mFontColor) graphics.setColor(mFontColor); super.paint(graphics); } }