Printing things in the console window with different colors?

I'd like to know if it is in any way possible to print data in the console window with custom colors. I'd like to be able to print certain things in one red, others in green or blue. Is this possible?

Thanks

1 comment
Comment actions Permalink

On Sun, 15 May 2011 02:17:13 MSD, Jorge Branco
<no_reply@jetbrains.com> wrote, quoted or indirectly quoted someone
who said :

>I'd like to know if it is in any way possible to print data in the console window with custom colors. I'd like to be able to print certain things in one red, others in green or blue. Is this possible?

Writing your own log class will let you do all kinds of fancy things
besides just select colours.

Fun stuff like colours that fade or gradually morph into another to
indicate age are possible.

You can work with JTable, JTextPane, JPanel.drawComponent

In the DOS days and early Windows (I don't know if it still supported)
you could configure your console to support ANSI escape sequences that
would let you set colours.  But this will not be WORA.
--
Roedy Green Canadian Mind Products
http://mindprod.com
How long did it take after the car was invented before owners understood
cars would not work unless you regularly changed the oil and the tires?
We have gone 33 years and still it is rare to uncover a user who
understands computers don't work without regular backups.

0

Please sign in to leave a comment.