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

New Developer
Posts: 5
Registered: ‎11-14-2008
My Device: Not Specified

Layout Manager losing scroll up and down arrow

The following code is my testing code for custom layout manager, just trying to have first half screen scrollable and 2nd half non-scrollable.  The first haf screen works, however, I don't see the upward scroll arrow and downward scroll arrow on the right side of screen.   How could I fix it so that I have half-screen scrollable with upward and downward arrow on right side?


Can anybody help me and post some sample codes?


Thank you very much.





 * Napolean.java
 * © <your company here>, 2003-2008
 * Confidential and proprietary.

package com.source;

import net.rim.device.api.ui.UiApplication;

import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;
import net.rim.device.api.system.*;


class Napolean extends UiApplication {
    public static void main (String[] args)
    Napolean theApp =new Napolean();
    public Napolean()
        pushScreen(new NP_RegisterScreen2());

class NP_RegisterScreen2 extends MainScreen {
         CustomManager_test Layout_test = new CustomManager_test(120);
            for (int i=0; i<10; i++)  {
                     ButtonField  btn =  new ButtonField( "test"+i);

    class CustomManager_test extends VerticalFieldManager
        int _managerHeight; // Total height of the manager
        int screen_width= Graphics.getScreenWidth();
        // Pass in desired height.  Scrolling is turned off in both directions.
        public CustomManager_test(int passHeight)
            super( VerticalFieldManager.VERTICAL_SCROLL);
            _managerHeight = passHeight;
        // Sublayout is called automatically to position all the internal fields to this
        // layout.  Its sublayouts job to read in the custom coordinates of each of the fields
        // and place them accordingly.
        protected void sublayout(int width, int height)
             Field field;
            int numberoofFields =getFieldCount();
            int x=0;
            int y=0;
            for (int lcv = 0; lcv < numberoofFields; lcv++)
                field = getField(lcv);
                setPositionChild(field, x, y);
                 layoutChild(field, width , height);
            //Set the manager's dimensions
            setExtent(width, _managerHeight);
        public int getPreferredWidth()
            return Graphics.getScreenWidth();
        public int getPreferredHeight()
            return Graphics.getScreenHeight();

Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Layout Manager losing scroll up and down arrow