Reputation: 477
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
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.
Upvotes: 1
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