Change color in java eclipse console

Is there a way to change the text color in the eclipse console?
I'm not talking about when I go to options and change color from black to red. I mean, when I run my program, and it executes the code, and at some point it changes color.
For instance:

//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 the Eclipse console.

+5
source share
1 answer

Perhaps using another org.eclipse.ui.console.MessageConsoleStream , given that:

Sending messages to the message console. ssed. A message console can have more than one thread connected to it.
Each stream can be displayed in a different color.

See this thread :

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

+6
source

Source: https://habr.com/ru/post/887529/


All Articles