wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes different colors in each letter of a string Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "different colors in each letter of a string" Watch "different colors in each letter of a string" New topic
Author

different colors in each letter of a string

sushant prabhu
Ranch Hand

Joined: Mar 22, 2001
Posts: 66
I am creating a ticker in an applet where i am using the drawString method of the Graphics class
. what i want is each letter of the string which will be painted by the drawString method on the applet should be in a different color.
say if my String is JAVA , i want J in a different color, A in a different color, V in a different color & A in a different color


Sushant Prabhu<br />SCJP2<br />SCWCD<br />OCA9i
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Here's a short example of how you could do that...



-Nate


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: different colors in each letter of a string