How to remove white color around Labelfield in Blackberry

185 views Asked by At

I am developing a blackberry app and I am new to Blackberry. I am using Label Field in every screens, but there is a color surrounding the LabelField other than the background I have given for the screen like the image I have given here..

enter image description here

This is a header in my App,which comes in every screens. Here you can see a white color around the "state editions". It does not look good. I want the orange background color at the place of white color. Thanks in advance...

1

There are 1 answers

1
Rupak On BEST ANSWER

You are using the following code.. (from your comment)

lF1= new LabelField("state editions",LabelField.FIELD_LEFT |FIELD_VCENTER) {
    public void paint(Graphics graphics) { 
        graphics.clear();
        graphics.setColor(Color.BLACK); 
        graphics.setBackgroundColor(Color.ORANGE); graphics.fillRect(0, 0,0, 0); 
        super.paint(graphics); 
    } 
}; 

Try to modify this like the following:

lF1= new LabelField("state editions",LabelField.FIELD_LEFT |FIELD_VCENTER) {
    public void paint(Graphics graphics) {             
        super.paint(graphics); 
    } 
}; 

That means, you don't have to extend default LabelField.

Just use,

lF1= new LabelField("state editions",LabelField.FIELD_LEFT |FIELD_VCENTER);

And check the Graphics , graphics.clear() etc in the API.