How can I color Java output?
For example in C and other languages I can use ANSI-escape like \033[0m to do this. But in Java it doesn’t work.
public static void main(String[] x) {
System.out.println("\033[0m BLABLA \033[0m\n");
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, but there are third party API’s that can handle it
http://www.javaworld.com/javaworld/javaqa/2002-12/02-qa-1220-console.html
Edit: of course there are newer articles than that one I posted, the information is still viable though.
Above link is dead, see this question instead: How to print color in console using System.out.println?