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: 108
Registered: ‎01-29-2009
My Device: BlackBerry 8700g
My Carrier: Tigo
Accepted Solution

Manage Icons on same screen

Hi Team,


I have the following icon in a file of my applicaction:



BitmapField phone = new BitmapField(Bitmap.getBitmapResource("phone.png"), FIELD_VCENTER);


 I need show  this icon more that once in the same file.


I have defined the following code:



_manager = (VerticalFieldManager)getMainManager(); _container_client_info = new VerticalFieldManager(); _container_phone = new HorizontalFieldManager(); _container_phone1 = new HorizontalFieldManager(); XYEdges rounded_edges = new XYEdges(11, 11, 11, 11); Border rounded_content = BorderFactory.createBitmapBorder(rounded_edges, Bitmap.getBitmapResource(_resources.getString(IMAGE_BOX))); _container_client_info.setBorder(rounded_content); String _pType = _seed.getElement(HopperData.PHONE_TYPE); String _pType1 = _seed.getElement(HopperData.PHONE_TYPE1); LabelField _phone_type = new LabelField(" " + _seed.getElement(HopperData.PHONE_TYPE) + ": "); LabelField _phone_type1 = new LabelField(" " + _seed.getElement(HopperData.PHONE_TYPE1) + ": "); LabelField _phone = new LabelField(_seed.getElement(HopperData.PHONE), LabelField.USE_ALL_WIDTH); LabelField _phone1 = new LabelField(_seed.getElement(HopperData.PHONE1), LabelField.USE_ALL_WIDTH); _container_client_info.add(_container_phone); _container_client_info.add(_container_phone1); if (_pType.equals("Cell")) _container_phone.add(cell); else _container_phone.add(phone); _container_phone.add(_phone_type); _container_phone.add(_phone); /** * Control for second phone. */ String telephone1 = _seed.getElement(HopperData.PHONE1); if (!telephone1.equals("0")) { if (_pType1.equals("Cell")) _container_phone1.add(cell); else _container_phone.add(phone); _container_phone1.add(_phone_type1); _container_phone1.add(_phone1); }


 The result show the following information:


icon1  Type of Phone 1: number of Phone.1

icon2  Type pf Phone 2: number of Phone 2


in this case the icon1 and icon2 are the same when the pphone type is differet to CELL




Phone type: Home

Phone Type: Work


I will show the same icon.


So, I have diferents managers verticals and horizontals for the phone 1 and phone 2  I  will have that define the following code two  times:


BitmapField phone = new BitmapField(Bitmap.getBitmapResource("phone.png"), FIELD_VCENTER);



 O How canuse the same icon two or more times in the same screen.



Jorge Luis



Jorge Luis Frias B

Leader on Development
BlackBerry/iPhone Technologies
Posts: 696
Registered: ‎12-02-2008
My Device: Not Specified

Re: Manage Icons on same screen



I think in the present scenario you have to create different BitmapField with the same resource i.e phone.png.


I think if it suits, you can use a listfield and in each row you can show different entries and use drawBitmap method to render same image.

Rajat Gupta.
If your problem was get solved then please mark the thread as "Accepted solution" and kudos - your wish