zfm
zfm

Reputation: 2006

coloring text with Java in Windows

I knew that in Linux Console we can write something like this

System.out.println("\033[31mhello");

so that the result will be "hello" (without quotes) and the color will be red...

is there any way to do this on windows? or is there any software that can handle the exactly same thing on windows?

Upvotes: 2

Views: 7835

Answers (2)

johnstok
johnstok

Reputation: 98300

You will probably need a .DLL file to get decent console output on windows. Try one of the following:

Upvotes: 1

eee
eee

Reputation: 1053

It is possible to format the Windows console command output...the caveat is that you need to load the ANSI.SYS driver...You can refer to the following links:

http://www.robvanderwoude.com/ansi.php

http://en.wikipedia.org/wiki/ANSI_escape_code

Upvotes: 1

Related Questions