Results 1 to 2 of 2
  1. #1
    Lang is offline Member
    Join Date
    Nov 2007
    Rep Power

    Default Changing the color of text


    I was just wondering how to change the color of text. I searched the Java API Documentation and the closest thing I could find was java.awt.

    However, I could not implement it without getting several errors.

    Could anyone supply me with a simple example? Preferably one that uses System.out.println();

    Thanks in advance,

  2. #2
    JavaBean's Avatar
    JavaBean is offline Moderator
    Join Date
    May 2007
    Rep Power


    As far as i know, you can not do that in a platform independent way with a console application.

    But for a Swing application you can easily do that by drawing text on top of a JPanel. Check Java2D for details:

    Trail: 2D Graphics (The Java™ Tutorials)

Similar Threads

  1. Help with switch color
    By Daniel in forum AWT / Swing
    Replies: 2
    Last Post: 09-18-2008, 07:54 AM
  2. Color coded code
    By tim in forum Suggestions & Feedback
    Replies: 11
    Last Post: 06-29-2008, 09:35 AM
  3. Color objects
    By CyberFrog in forum New To Java
    Replies: 4
    Last Post: 04-01-2008, 12:41 AM
  4. Changing color of variables view details
    By mtoledo in forum Eclipse
    Replies: 0
    Last Post: 03-25-2008, 02:35 PM
  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