madcoderz
madcoderz

Reputation: 4431

how to show text label on buttonField blackberry

Im new to blackberry development. Im trying to put text over a Button but its not working at all. There should be an easy solution but i'm unable to find it. Here's the code im using

public class ProgramListView extends VerticalFieldManager{

    private int _height;
    private int _xPos;

    private ButtonField evaluateButton;

    //height is used to define each item height
    //xPos is used to define each items position on screen
    public ProgramListView(int height, int xPos){
        this._height = height;
        this._xPos = xPos;

        evaluateButton = new ButtonField("Evaluate", ButtonField.CONSUME_CLICK){

            //put methods in here to change the button's position
        };
        super.add(evaluateButton);
    }

Thanks in advance.

Upvotes: 0

Views: 214

Answers (2)

madcoderz
madcoderz

Reputation: 4431

The problem is now solved. The solution was obvious. As i put the button on a custom VerticalFieldManager, in the VerticalFieldManager's sublayout method i had to change the parameters in it to Display.USE_ALL_WIDTH. That fixed the problem Thanks for the help.

Upvotes: 0

SALMAN
SALMAN

Reputation: 2031

ButtonField btnPreviewTone;
btnPreviewTone = new ButtonField(ButtonField.HIGHLIGHT_SELECT |       ButtonField.CONSUME_CLICK);
btnPreviewTone.setLabel("Preview Ringtone");

I did this way and it worked for me. Thanks

Upvotes: 1

Related Questions