Fixed width button trick not working correctly...
I have tested the trick given here
BlackBerry Fixed Width ButtonField (also here http://www.blackberryforums.com/deve...set-width.html)
... plus adding a Style so can be centered
my idea was to make it 30 pixels less than the screen width
so.. I have this
Iīm using JDE 4.5.0
any ideas?? :smile:
Thanks in advance...
Field.FIELD_HCENTER only centers the Field object within the manager.
To center the text, add DrawStyle.HCENTER to the style parameter.
but your solution doesn't change anything. I'm still seeing the text aligned to the left in the button :-(
Do you think it has something to do with my JDE version?
Thanks for your time.
Did you find a solution for this?
If it still matters ....
To center the text in the button,
override paint in FixedWidthButtonField with something like:
Font font = Font.getDefaultFont();
int textWidth = font.stringWidth(getLabel());
g.drawText(getLabel(), (width - textWidth) / 2, 0);
|All times are GMT -5. The time now is 12:14 AM.|
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.