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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Developer
JoVinz
Posts: 255
Registered: ‎05-03-2012
My Carrier: Vodafone

Focus Color of ObjectChoiceField

I want to change focus color of objectchoicefield. I have used following code. But still i am getting default focus color i.e. blue.


combo = new ObjectChoiceField("",choice)
{
boolean _inFocus = false;
public void onFocus(int direction)
{
_inFocus = true;
super.onFocus(direction);
this.invalidate();
}
public void onUnfocus()
{
_inFocus = false;
super.onUnfocus();
this.invalidate();
}
public void paint(Graphics g)
{
g.setColor(Color.BLACK);
if ( _inFocus )
g.setBackgroundColor(0x00D8632E);
else
g.setBackgroundColor( Color.WHITE );
g.clear();
super.paint(g);
}
};

Please use plain text.
Developer
kamal_nigam
Posts: 416
Registered: ‎07-23-2012
My Carrier: Orange

Re: Focus Color of ObjectChoiceField

check this

http://stackoverflow.com/questions/9617970/how-to-change-background-color-of-object-choice-field-in-...

 

Thanks
-------------------------------------------------------------------------------------
Press the Accept as solution Button when u got the Solution
Press Kudo to say thank to developer.
-------------------------------------------------------------------------------------.
Please use plain text.
Developer
JoVinz
Posts: 255
Registered: ‎05-03-2012
My Carrier: Vodafone

Re: Focus Color of ObjectChoiceField

This is not working. When i setBackgroud() to objectchoicefield,the background color is set for whole manager. :smileysad:
Please use plain text.
Developer
simon_hain
Posts: 13,754
Registered: ‎07-29-2008
My Carrier: O2 Germany

Re: Focus Color of ObjectChoiceField

there was an API that supported that but it was discontinued, you would have to customize 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
Please use plain text.
Developer
JoVinz
Posts: 255
Registered: ‎05-03-2012
My Carrier: Vodafone

Re: Focus Color of ObjectChoiceField

How should i customize this objectchoicefield?
Please use plain text.
Developer
simon_hain
Posts: 13,754
Registered: ‎07-29-2008
My Carrier: O2 Germany

Re: Focus Color of ObjectChoiceField

for the selection i would suggest a popupscreen with an objectlistfield.
----------------------------------------------------------
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
Please use plain text.
Developer
JoVinz
Posts: 255
Registered: ‎05-03-2012
My Carrier: Vodafone

Re: Focus Color of ObjectChoiceField

Please use plain text.
Developer
peter_strange
Posts: 17,629
Registered: ‎07-14-2008

Re: Focus Color of ObjectChoiceField

Resolved then?

 

Please mark it so.....

Please use plain text.
Developer
JoVinz
Posts: 255
Registered: ‎05-03-2012
My Carrier: Vodafone

Re: Focus Color of ObjectChoiceField

how to use pop up screen with objectchoiceield?
Please use plain text.
Developer
peter_strange
Posts: 17,629
Registered: ‎07-14-2008

Re: Focus Color of ObjectChoiceField

Simons suggestion was a PopupScreen with an ObjectListField. 

Please use plain text.