Question

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...

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top