BlackBerry Forums Support Community

BlackBerry Forums Support Community (
-   Developer Forum (
-   -   Custom button paint problem (

sickned 12-12-2008 05:56 AM

Custom button paint problem

I have a custom button that has to be next to a labelfield.

The paint code of the button is this:
protected void paint(Graphics graphics) {
graphics.drawBitmap(13, 0, fieldWidth, fieldHeight, button, 0, 0,);


Where "13" is the a space between labelfield and button.

But when the size font is bigger, the result is this:

The button is cutted and other times its even more.

What could be a solution?

Thanks in advance.

jwb 12-12-2008 12:48 PM

You need to setFont() on your ButtonField, if you want to constrain the size of the text. But it looks to me like you would also have a problem if the price was higher, such as "123456,78 EUR/100kg" it could be very long, no?

All times are GMT -5. The time now is 09:13 PM.

Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.