Apple_Magic
Apple_Magic

Reputation: 477

how to add 2 vertical field managers on third vertical field manager in blackberry?

enter image description here

Hi please tell me how to make this screen in blackberry. my data is not adding on it.i took vertical field manager to add all components.

Upvotes: 1

Views: 142

Answers (2)

Arun Kumar Munusamy
Arun Kumar Munusamy

Reputation: 871

Its working.. I created it for you. use this code

public class home extends UiApplication {

public static void main(String[] args)
{
    home app = new home();
    app.enterEventDispatcher();
}

MainScreen screen = new MainScreen();
private int deviceWidth = Display.getWidth();
private int deviceHeight = Display.getHeight();
LabelField lbl1 = new LabelField("label");
final Bitmap backgroundBitmap = Bitmap.getBitmapResource("bg1.jpg");
final Bitmap backgroundBitmap1 = Bitmap.getBitmapResource("bg2.jpg");
final BitmapField mybitmapField = new BitmapField(Bitmap.getBitmapResource("facebook-logo.jpg"),DrawStyle.HCENTER);

public home()
{
    super();
    pushScreen(screen);

    VerticalFieldManager mainManager = new VerticalFieldManager(Manager.NO_VERTICAL_SCROLL | Manager.NO_VERTICAL_SCROLLBAR )
        {          
            public void paint(Graphics graphics)
            {
                graphics.clear();
                graphics.drawBitmap(0, 0, deviceWidth, deviceHeight, backgroundBitmap, 0, 0);                       
                super.paint(graphics);
            }            
        };
      //this manger is used for adding the componentes
    VerticalFieldManager subManager = new VerticalFieldManager(Manager.NO_VERTICAL_SCROLL | Manager.NO_VERTICAL_SCROLLBAR )
        {
            public void paint(Graphics graphics)
            {
                graphics.clear();
                graphics.drawBitmap(0, 0, deviceWidth, deviceHeight, backgroundBitmap1, 0, 0);                       
                super.paint(graphics);
            }   
        };

        screen.add(mainManager);
        mainManager.add(lbl1);
        mainManager.add(subManager);

        subManager.add(mybitmapField);
        subManager.add(new LabelField("Data 1"));
        subManager.add(new LabelField("Data 1"));
        subManager.add(new LabelField("Data 1"));
}   
}

output will be like this. enter image description here

Upvotes: 1

Farid Farhat
Farid Farhat

Reputation: 2310

Find an example of how to make this screen below:

    VerticalFieldManager manager = new VerticalFieldManager();
    VerticalFieldManager first = new VerticalFieldManager();
    VerticalFieldManager second = new VerticalFieldManager();

    first.add(label);
    second.add(image);
    second.add(data);
    second.add(data);
    second.add(data);

    manager.add(first);
    manager.add(second);
    add(manager);

Upvotes: 0

Related Questions