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

Forums Advisor I
Posts: 501
Registered: ‎03-01-2013
My Device: BlackBerry Z10

problm in custom button field

[ Edited ]

I have made a custom button and now i have to add the text in the middle bt by default it starts from the left.code is

public CustomButton(String text,int background,int foreground)
so i want that the text in the butonfieldstarts from the center..
can anyone help me...??
Thanks in advance..

Posts: 17,019
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: problm in custom button field

try different styles, like HCENTER or FIELD_HCENTER etc
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: problem in custom button field

As suggested elsewhere, if you want a more accurate answer, then you will need to include more detail from your CustomButton - the code you have supplied is not helpful in determining what changes might resolve your problem. 

Regular Contributor
Posts: 64
Registered: ‎01-27-2011
My Device: Not Specified

Re: problm in custom button field

You may need to override the layout method or perhaps just the paint method. Perhaps this link might help you find the solution that works for you.




The Vertical Button Set sample was useful to me when I was implementing a custom button.