When trying to use the ANSI escape codes, it would not work. I would assume this is because JCreator
does not support these escape codes. Is there any other way to print out color when using System.out.println
? The ANSI codes I am using is below along with what I am trying to print as a trial. The code is inside a class and it is running properly.
final String ANSI_RESET = "\u001B[0m";
final String ANSI_BLACK = "\u001B[30m";
final String ANSI_RED = "\u001B[31m";
final String ANSI_GREEN = "\u001B[32m";
final String ANSI_YELLOW = "\u001B[33m";
final String ANSI_BLUE = "\u001B[34m";
final String ANSI_PURPLE = "\u001B[35m";
final String ANSI_CYAN = "\u001B[36m";
final String ANSI_WHITE = "\u001B[37m";
System.out.println(ANSI_RED + "This text is red!" + ANSI_RESET);