Change color in java eclipse console

16,678

Probably by using a different org.eclipse.ui.console.MessageConsoleStream, considering that:

It is ssed to write messages to a message console.
A message console may have more than one stream connected to it.
Each stream may be displayed in a different color

See this thread:

IOConsoleOutputStream has a setColor(Color newColor), so I can MessageConsole.getInputStream().setColor(Color newColor) for each type of message.

Share:
16,678
randomUser56789
Author by

randomUser56789

Enthusiastic programmer.

Updated on June 12, 2022

Comments

  • randomUser56789
    randomUser56789 almost 2 years

    Is there any way to change text color in eclipse console?
    I am not talking about when I go to options and change color from black to for example red.
    I mean like when I launch my program and it executes code and at some point it changes color.
    For example:

    //code  
    if (a == 2)  
    //change text color to red and continue typing in red color
    

    I am not talking about guis jframes etc. I am talking about Eclipse console.

  • Rakesh Juyal
    Rakesh Juyal about 13 years
    I never knew about that :) Thnx
  • chandsie
    chandsie almost 13 years
    I am assuming this doesn't work if I execute the program from the console. Or am I wrong to assume this? If indeed I am right, then is there any other alternative(besides using a more cli oriented language)?