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

Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.

Posts: 558
Registered: ‎11-25-2008
My Device: Not Specified

Re: How to put Image on Buttonfield?

I don't see why you couldn't use a ButtonField and override drawFocus and onUnFocus or whatever those functions are to draw a bitmap or something in there.


Likewise, you could use the Custom one.


Again, the BitmapField works good too, but I prefer to use that as a canvas type Field.


I haven't really thought about this one. I just assumed that you could put an image in a ButtonField.


I'll have to look at this more closely tomorrow as I need to do this too (just haven't gotten there yet).




New Developer
Posts: 8
Registered: ‎04-02-2009
My Device: Not Specified

Re: How to put Image on Buttonfield?

Yeah, I had a look at it. But even in the sample app, the click on the Picture Button works but the event also fires when I click outside the button!!! How can I fix that???

Try clicking on the button first, an then outside the button! Thats strange!

New Developer
Posts: 9
Registered: ‎04-04-2009
My Device: Not Specified

Re: How to put Image on Buttonfield?

if you're just clicking the screen again after having clicked your imagebutton once, the focus is still on the bitmapfield and so that focused element is what gets triggered by the click.  you'll notice that if you use the touchscreen to set focus on some other element, then click, it won't trigger again.


so here's what i do: in my navigationClick() override method, the last thing i do is just call setFocus() on some other element (such as my editfield) so that any button clicks won't actually trigger anything.

Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: How to put Image on Buttonfield?

"Try clicking on the button first, an then outside the button!" Outside the button means, do you have any other Fields in the screen.

It works for me as expected. You can try giving the style as ButtonField.Consume_Click.

Use Search. "Accept Solution" If the problem is resolved.
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810

Re: How to put Image on Buttonfield?

It seems you have some other fields also.. In the listener, check a condition on which component has raised the event..



Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group
New Contributor
Posts: 6
Registered: ‎03-31-2014
My Device: 9900
My Carrier: Blackberry

Re: How to put Image on Buttonfield?

Hi I have a problem to add image with text in button field using java. It is possible to do using c++.

Please can any one help me.

Here is c++ plus QML link : https://developer.blackberry.com/native/reference/cascades/bb__cascades__button.html

I want to do the same using java.



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

Re: How to put Image on Buttonfield?

[ Edited ]

Welcome to the forums.


I think Mark has already answered your question, in this post: