BlackBerry Forums Support Community

BlackBerry Forums Support Community (http://www.blackberryforums.com/)
-   Developer Forum (http://www.blackberryforums.com/developer-forum/)
-   -   Custom button paint problem (http://www.blackberryforums.com/developer-forum/164782-custom-button-paint-problem.html)

sickned 12-12-2008 05:56 AM

Custom button paint problem
 
Hi,

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 01:24 PM.

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