Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 9 of 9

Thread: Coloured text

  1. #1
    Junior Member
    Join Date
    Oct 2009
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Coloured text

    Hi all

    I have had a scan in this area and in tutorials so apologies if this has been answered

    I would like to get "invalid entry return to main menu." in red when the program is running

    and also how can I crate a Background colour.

    Many thanks


  2. #2
    Senile Half-Wit Freaky Chris's Avatar
    Join Date
    Mar 2009
    Posts
    834
    My Mood
    Cynical
    Thanks
    7
    Thanked 105 Times in 90 Posts

    Default Re: Coloured text

    Is this a GUI? and what is "Invalid entry return to main menu"?

    Chris

  3. #3
    Junior Member
    Join Date
    Oct 2009
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Coloured text

    no not a gui just a runnin program with menu and the invalid entry return to menu is the words i would like to get in red just to make them stand out better against the standard menu I have in black.

  4. #4
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,895
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: Coloured text

    From the console, you can print out to the System.err stream, but be warned that if you're capturing the output of this program, it won't capture anything printed out to the err stream (I know that Eclipse will print it out as red, not sure if running it from an actual console will).

  5. #5
    Senile Half-Wit Freaky Chris's Avatar
    Join Date
    Mar 2009
    Posts
    834
    My Mood
    Cynical
    Thanks
    7
    Thanked 105 Times in 90 Posts

    Default Re: Coloured text

    Simple answer, no you cannot do it.

    Unless you go to JNI

    Chris

  6. #6
    Super Moderator Json's Avatar
    Join Date
    Jul 2009
    Location
    Warrington, United Kingdom
    Posts
    1,274
    My Mood
    Happy
    Thanks
    70
    Thanked 156 Times in 152 Posts

    Default Re: Coloured text

    JNI is the solution to everyones problems

    // Json

  7. #7
    Senile Half-Wit Freaky Chris's Avatar
    Join Date
    Mar 2009
    Posts
    834
    My Mood
    Cynical
    Thanks
    7
    Thanked 105 Times in 90 Posts

    Default Re: Coloured text

    Agrees with JSon....which sugests C++ or C is the solution and Java is a waste of time rofl

  8. #8
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,895
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: Coloured text

    It doesn't necessarily have to be C++/C that you can link in with JNI. There's Ruby, Perl, Lisp, Pascal, COBOL, ... Granted, a lot of these languages aren't very good

  9. #9
    Senile Half-Wit Freaky Chris's Avatar
    Join Date
    Mar 2009
    Posts
    834
    My Mood
    Cynical
    Thanks
    7
    Thanked 105 Times in 90 Posts

    Default Re: Coloured text

    You deserve to be shot for suggesting those.

Similar Threads

  1. inputting of text
    By Subhasis Banerjee in forum JavaServer Pages: JSP & JSTL
    Replies: 3
    Last Post: October 30th, 2009, 12:53 PM
  2. java. Text problem...
    By Ranger-Man in forum Java SE APIs
    Replies: 8
    Last Post: September 7th, 2009, 07:19 PM
  3. How to format text in java?
    By fourseven in forum Java Theory & Questions
    Replies: 3
    Last Post: May 16th, 2009, 09:42 PM
  4. Java program to reduce spaces between the words in a text file
    By tyolu in forum File I/O & Other I/O Streams
    Replies: 2
    Last Post: May 13th, 2009, 07:17 AM