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

    Default Changing the color of text

    Hey,

    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,
    Lang

  2. #2
    JavaBean's Avatar
    JavaBean is offline Moderator
    Join Date
    May 2007
    Posts
    1,270
    Rep Power
    9

    Default

    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, 08:54 AM
  2. Color coded code
    By tim in forum Suggestions & Feedback
    Replies: 11
    Last Post: 06-29-2008, 10:35 AM
  3. Color objects
    By CyberFrog in forum New To Java
    Replies: 4
    Last Post: 04-01-2008, 01:41 AM
  4. Changing color of variables view details
    By mtoledo in forum Eclipse
    Replies: 0
    Last Post: 03-25-2008, 03:35 PM
  5. A bit of color!
    By tim in forum Java 2D
    Replies: 8
    Last Post: 02-12-2008, 12:57 AM

Posting Permissions

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