Results 1 to 2 of 2

Thread: String color

  1. #1
    Join Date
    Jan 2011
    Posts
    13
    Rep Power
    0

    Default String color

    Java Code:
    	private void paintInfo(Graphics g) {
    		Graphics2D g2d = (Graphics2D) g;
    		if(plr.isInfo){
    			g2d.drawString("foo1", 100, 105); // Blue
    			g2d.drawString("foo2", 100, 110); // Red
    			g2d.drawString("foo3", 100, 115); // Green
    			g2d.drawString("foo4", 100, 120); // Orange
    		}
    	}
    How do i change the color of an individual string?

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

Similar Threads

  1. SetColor GOBJECT passing a string for color
    By Hollywood_99 in forum New To Java
    Replies: 0
    Last Post: 10-17-2010, 11:25 PM
  2. if (...) ... won't set color
    By livingdog in forum New To Java
    Replies: 6
    Last Post: 04-11-2010, 03:59 PM
  3. [COLOR="Navy"]execute .bat file in mysql [/COLOR]
    By msankar.ravi in forum Networking
    Replies: 0
    Last Post: 02-24-2010, 04:27 AM
  4. How to change string Color
    By Java.child in forum AWT / Swing
    Replies: 3
    Last Post: 01-06-2009, 04:27 AM
  5. A bit of color!
    By tim in forum Java 2D
    Replies: 8
    Last Post: 02-11-2008, 11:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •