• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Change Color of StringItem

 
Koh Khai Huat
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,

Do you guys know of any method to change the color of the text in a StringItem
or any way to change the color of the text on the form it self thanks in advance

regards
Khai Huat
 
Tim Holloway
Saloon Keeper
Posts: 18359
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You won't be able to to it using println - that's not a screen output function!

Actual screen display controls posess properties that define their fonts, text color and other display attributes.
 
Syam Sathyan George
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Khai,

simple solution -

1,Make a CustomItem and override the paint() method.
2a,set the Graphics parameter of the paint method to desired color.
2b,print the any string into the Graphics parameter of the paint method.
3,Add this CustomItem to the Form.

TADA!!! and you see the String in Color inside the form.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic