Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Colored console output ?

 
Andy Jack
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to make java code that displays multicolored output on the console ?
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic