Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Posts: 143
Registered: ‎07-14-2008
My Device: Not Specified

Alignment problem

What am I doing wrong here?  I get the icon to draw fine, but I want the LabelField to draw at the bottom of the manager.


        iconManager = new VerticalFieldManager(Field.NON_FOCUSABLE | Manager.NO_VERTICAL_SCROLL | VerticalFieldManager.USE_ALL_HEIGHT | VerticalFieldManager.FIELD_BOTTOM){
            // Override paint method to draw a background image
            public void paint(Graphics g){
                bgBitmap = Bitmap.getBitmapResource(panelManager.getColorChoice(panelManager.getSelectedIndex()) + "B.png");
                g.drawBitmap(0, 0, bgBitmap.getWidth() , bgBitmap.getHeight(), bgBitmap, 0, 0);
        iconLabel = new LabelField(" crackberry.com ", LabelField.FIELD_HCENTER | LabelField.FIELD_BOTTOM);


With the code above (and every variation I've tried) the LabelField text remains at the top of the manager.


BlackBerry Development Advisor
Posts: 15,882
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Alignment problem

Note that the bottom of the manager and the bottom of the screen can be 2 different things.  If you want a label to appear at the bottom of your screen you could use the status area of a MainScreen (use the setStaus method of MainScreen).
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Posts: 143
Registered: ‎07-14-2008
My Device: Not Specified

Re: Alignment problem

I'm aware of the difference.


The problem is, that the LabelField remains stuck to the top of the manager, no matter what I do.  I suspect the problem is that the manager contains ONLY this LabelField, although it's painted with a background.


One can see that the manager is clearly large enough to contain the bitmap (64 pixels x 64 pixels), but the text remains at the top!


Try the code and you will see what I mean.


Posts: 696
Registered: ‎12-02-2008
My Device: Not Specified

Re: Alignment problem

[ Edited ]



I guess you want to show picture and below it label for it, then instead of overriding paintBackground() add a BitmapField in manager and then add lable below it.



Please let me know it helped or not


Sorry to late to answer this thread did'nt see the date.

Message Edited by Rajat_10Sep on 04-18-2009 01:50 AM
Rajat Gupta.
If your problem was get solved then please mark the thread as "Accepted solution" and kudos - your wish