开发者

Change color in java eclipse console

开发者 https://www.devze.com 2023-02-27 20:51 出处:网络
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.

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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号