Welcome!

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

Reply
Developer
bbman
Posts: 20
Registered: ‎06-01-2009
My Device: Not Specified

How to change the highlight color of a buttonfield

Hi, I've been trying to change the highlight color of my buttonfield for a long time now and I can't seem to find the right method to do it. I tried overriding the onFocus method and set my own backgroud, but then it only change the background on the text part of the button, not the whole button. The method drawFocus doesn't get called when it's on focus, so I can't override that, and I can't use drawHighlightRegion as well because it's final. Does anyone have any idea, please? Thank you very much
Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: How to change the highlight color of a buttonfield

drawHighlightRegion is the correct method. as it is final you can't overwrite it but have to create your own field.
----------------------------------------------------------
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
Developer
bbman
Posts: 20
Registered: ‎06-01-2009
My Device: Not Specified

Re: How to change the highlight color of a buttonfield

[ Edited ]
Ah man, there is no other way than to create my own buttonfield, huh? Ok, I'll have to go down that road then. Thank you Simon
Message Edited by bbman on 07-29-2009 10:55 AM
Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: How to change the highlight color of a buttonfield

buttonfield is quite complicated and has at least one bug, too.
personally i use a modified bitmapfield for buttons. makes the application bigger, of course.
----------------------------------------------------------
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