File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Colored console output ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Colored console output ?" Watch "Colored console output ?" New topic

Colored console output ?

Andy Jack
Ranch Hand

Joined: Nov 22, 2012
Posts: 257
Is it possible to make java code that displays multicolored output on the console ?

Java Newbie with 72% in OCJP/SCJP - Super Confused Jobless Programmer.
I am a "newbie" too. Please verify my answers before you accept them.
Steve Luke

Joined: Jan 28, 2003
Posts: 4181

There is no cross-platform way to do it. There are ANSI codes which work on Unix type systems, but they don't work on Windows. To get it to work on Windows you will need a library of some sort. A good Google search should help you find the ANSI codes and several libraries for Windows to choose from (maybe JAnsi or something like that? I forget, bu there are multiple).

I agree. Here's the link:
subject: Colored console output ?
It's not a secret anymore!