Welcome!

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

Reply
Developer
gxgraham
Posts: 28
Registered: ‎07-16-2008
My Device: Curve 8320
Accepted Solution

Blackberry Wallet TreeField.

I would like to implement something similar to the blackberry wallet application where there is an icon next to text in the TreeField.  I've been able to pass a String to the TreeField and have it display fine.  Does anyone know how I would go about adding a bitmap to that text. I've tried to use other net.rim.device.api.ui.component components without much sucess.

 

Thanks in advance,

 

 

Please use plain text.
Developer
Developer
gtj
Posts: 319
Registered: ‎07-20-2008
My Device: Not Specified

Re: Blackberry Wallet TreeField.

Here's a snippet of what I do...

 

public final class TreeScreen extends TreeField { /**/ } class TreeScreenCallback implements TreeFieldCallback { public void drawTreeItem(TreeField tf, Graphics graphics, int node, int y, int width, int indent) { Object cookie = tf.getCookie(node); Bitmap ic = /*set your icon*/ graphics.drawBitmap(indent, y, ic.getWidth(), ic.getHeight(), ic, 0, 0); indent += ic.getWidth(); graphics.drawText(cookie.toString(), indent, y, Graphics.ELLIPSIS, width); } }

 

 

 

Please use plain text.
Developer
gxgraham
Posts: 28
Registered: ‎07-16-2008
My Device: Curve 8320

Re: Blackberry Wallet TreeField.

That does the trick ... thanks gtj. 
Please use plain text.