javablackjack

How can I write bold text in the console for Java?


I am making a Blackjack program using Java, and I want to add bold text to it; however, I am having trouble knowing how to do that. Can anyone help?

I have tried to look up escape codes for it (I know they exist, I just don't remember them) on here and on the web, but couldn't find anything useful.


Solution

  • Here is one way to write texts bold on console for IDEs like NetBeans and Eclipse

    String boldText= "Java_Bold_Text";
    System.out.print("\033[0;1m" + boldText);