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
sweta03
Posts: 17
Registered: ‎08-23-2012
My Carrier: Vodafone

how to change text color of TextSpinBoxField?

Hi All,

 

 can u tell me how to change text color of TextSpinBoxField.

Please use plain text.
Developer
tklanilkumar
Posts: 206
Registered: ‎02-22-2011
My Carrier: idea

Re: how to change text color of TextSpinBoxField?

Below thread may help check it and tell us..

http://supportforums.blackberry.com/t5/Java-Development/TextSpinBoxField-color/td-p/584127
*****************************************************************************
* Give kudos when you like it
* Mark it as a solution if it fixes your issue
Please use plain text.
Developer
madiha
Posts: 107
Registered: ‎05-26-2011
My Carrier: Mobilink

Re: how to change text color of TextSpinBoxField?

override the  paint method of your field and use this code

public void paint(Graphics graphics) {
  graphics.setColor(Color.GREEN); super.paint(graphics); }

 

Please use plain text.
Developer
sweta03
Posts: 17
Registered: ‎08-23-2012
My Carrier: Vodafone

Re: how to change text color of TextSpinBoxField?

Hi Madiha,

 

it's not working.

Please use plain text.
Developer
sweta03
Posts: 17
Registered: ‎08-23-2012
My Carrier: Vodafone

Re: how to change text color of TextSpinBoxField?

this is my code.

 

 

TextSpinBoxField txt = new TextSpinBoxField(choice) {
			public void paint(Graphics graphics) {
				if (isFocus())
					setBackground(BackgroundFactory.createLinearGradientBackground(Color.AQUA, Color.AQUA, Color.AQUA, Color.AQUA));
				else
					setBackground(BackgroundFactory.createLinearGradientBackground(Color.BLACK, Color.BLACK, Color.BLACK, Color.BLACK));

				graphics.setColor(Color.RED);
				super.paint(graphics);

			}

			protected void drawFocus(Graphics graphics, boolean on) {
			}
		};

 

Please use plain text.
Developer
sweta03
Posts: 17
Registered: ‎08-23-2012
My Carrier: Vodafone

Re: how to change text color of TextSpinBoxField?

Hi All,

 

Plz help me..

Please use plain text.