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
New Contributor
kahoat
Posts: 2
Registered: ‎11-15-2010

change AutoCompleteField border

Hi, I am trying to change AutoCompleteField border with a border that respond to focus change by changing color.  I succeed in removing the default border by AutoCompleteField_instance.getEditField().setBorder(/*custom border*/);.  But it failed to respond to focus property: only some part of the color changed.  I also tried to override paintBackground, but the result is the same, however both technique works for EditField.

Does anyone succeed in doing what I am trying to do?

Apart from the main problem, AutoCompleteField that are used in the application always leave blue cursor even when not focussed, unlike EditField, and it also leave grey background inconsistently.  

I also have difficulties in typing text that is not in the choices.

Thank you for your help.

Please use plain text.
Developer
nishant30197
Posts: 49
Registered: ‎02-25-2011
My Carrier: Vodafone

Re: change AutoCompleteField border

kahoat did you find solution to autoCompleteField always leave blue cursor even when not focussed problem.

Thanks And Regards,
Nishant
Please use plain text.
Contributor
Dsheel
Posts: 24
Registered: ‎01-24-2011

Re: change AutoCompleteField border

use the foll: setBorder(BorderFactory.createRoundedBorder(new XYEdges(int,
                int,int,int), color,
                Border.STYLE_FILLED));

 

Add this in onFocus() and onUnFocus and pass the 'color' accordingly. This shud solve your border problem.

 

About the "Blue Cursor problem"...i solved it by painting each char that is entered and displayed a pipe operator as a cursor depding on the current cursor position.

 

 

Please use plain text.