Results 1 to 9 of 9
  1. #1
    schutter07's Avatar
    schutter07 is offline Member
    Join Date
    Nov 2010
    Location
    Belgium
    Posts
    3
    Rep Power
    0

    Default Multiple colors in print-statement

    I'm wondering if it possible to print multiple colors by using System.out.println();

  2. #2
    berkeleybross's Avatar
    berkeleybross is offline Senior Member
    Join Date
    Feb 2010
    Location
    England
    Posts
    187
    Rep Power
    5

    Default

    I did a quick google because i dont know the answer, and this forum looked like it might be helpful... post number 6 in particular.

    Text color in Windows console

    hope this helps!

  3. #3
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default

    But what about the response in #9? I tried this and see the same (unfortunate) thing as the OP of that thread.

    I note in passing that #4 and #10 are responses by "names" in the Java online world who I would trust.

  4. #4
    al_Marshy_1981 is offline Senior Member
    Join Date
    Feb 2010
    Location
    Waterford, Ireland
    Posts
    748
    Rep Power
    5

    Default

    "freaks out" :D

  5. #5
    schutter07's Avatar
    schutter07 is offline Member
    Join Date
    Nov 2010
    Location
    Belgium
    Posts
    3
    Rep Power
    0

    Default

    I tried the #6 on that forum, but no result.
    Maybe it is important to know that I use Mac OS X 10.6.5 and as program I use DrJava.

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

  7. #7
    schutter07's Avatar
    schutter07 is offline Member
    Join Date
    Nov 2010
    Location
    Belgium
    Posts
    3
    Rep Power
    0

    Default

    Quote Originally Posted by Fubarable View Post
    My take on this is if you want multicolored output, then your best bet is to create a GUI app.
    I don't understand what you are saying, I only know Java for 2 months. So I only have a basic knowledge about it.

  8. #8
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,433
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by schutter07 View Post
    I don't understand what you are saying, I only know Java for 2 months. So I only have a basic knowledge about it.
    In the old days there were even 'paper consoles'; you can't change the colour of ink; a lot of consoles (terminals) are monochrome and you can't change their colours either. Colour terminals all use different commands or codes to change their colours. There is no standard way to do it. A Java GUI can display different colours in a standard way (as long as it is Java). An alternative is jcurses; it's an attempt to support all those different consoles so that you (the jcurses user) only have to deal with jcurses' way of communicating with any console.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

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

    Default

    Quote Originally Posted by schutter07 View Post
    I don't understand what you are saying, I only know Java for 2 months. So I only have a basic knowledge about it.
    You seem to want a more varied and aesthetically pleasing output for the user, and the avenue you choose to try to do this with, the Java console is not suited for this. Instead you could create a GUI or graphical user interface Java program with the Swing library. If you are unfamiliar with this, you may wish to Google this for more information.

Similar Threads

  1. How to format the print statement
    By ftrengnr in forum New To Java
    Replies: 1
    Last Post: 09-18-2010, 10:02 PM
  2. problems with print statement
    By soccer_kid_6 in forum New To Java
    Replies: 8
    Last Post: 03-22-2010, 02:24 PM
  3. One controller with multiple buttons and colors
    By Cutter in forum New To Java
    Replies: 5
    Last Post: 01-24-2010, 06:47 PM
  4. How do I use multiple background colors?
    By trbox in forum New To Java
    Replies: 1
    Last Post: 09-02-2008, 01:00 PM
  5. how to set multiple colors in a JtextArea
    By valery in forum AWT / Swing
    Replies: 2
    Last Post: 08-01-2007, 05:12 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
  •