title: How to use multiple colors when using drawString() in java.awt.graphics?
body: <p>Okay, so here is the problem.</p>
  
  <pre><code>g.setColor(Color.WHITE);
  g.drawString("all your base belong to us",x,y);
  </code></pre>
  
  <p>The follow code makes it so that the string displayed is white and fully white.</p>
  
  <p>My aim is to make a certain section of the string, say for example, I want the word "base" in that string to be a different color, yellow in this case.</p>
  
  <p>The code that I would most likely use would be:</p>
  
  <pre><code>g.drawString("all your #ffd700base belong to us",x,y);
  </code></pre>
  
  <p>That code attempts to set the text to be yellow from 'base' all the way to the end of the sentence.</p>
  
  <p>Though the output of that is:</p>
  
  <p><a href="http://i.stack.imgur.com/lB2WC.png" rel="nofollow">http://i.stack.imgur.com/lB2WC.png</a></p>
  
  <p>Ignore the background, just look at the string. The "#ffd700" becomes a part of the string which is then displayed.</p>
  
  <p>This doesn't work, I cannot find a solution that does.</p>