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

how to change text color of TextSpinBoxField?

Hi All,

 

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

Developer
Posts: 206
Registered: ‎02-22-2011
My Device: BB TORCH & 9800
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
Developer
Posts: 107
Registered: ‎05-26-2011
My Device: Torch
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); }

 

Developer
Posts: 17
Registered: ‎08-23-2012
My Device: Bold
My Carrier: Vodafone

Re: how to change text color of TextSpinBoxField?

Hi Madiha,

 

it's not working.

Developer
Posts: 17
Registered: ‎08-23-2012
My Device: Bold
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) {
			}
		};

 

Developer
Posts: 17
Registered: ‎08-23-2012
My Device: Bold
My Carrier: Vodafone

Re: how to change text color of TextSpinBoxField?

Hi All,

 

Plz help me..