Skip to content
Sign UpLog In
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs
2

Java Colors

Bunnytoes
Bunnytoes

I wanted to set the color for the text in java and I got it to get a color, but now I want to set the color, but java doesn't have a SystemColor.setColor(); but it has a SystemColor.getColor();, how can I get it to work?

1 year ago

Voters

Comments

TopNew
2
Coder100
Coder100

Use escape codes instead.

System.out.println("\x1b[1mbold text\x1b[0m");

https://en.wikipedia.org/wiki/ANSI_escape_code#Colors

1 year ago
1
Bunnytoes
Bunnytoes

@Coder100
ok, thanks edit: it doesn't work

1 year ago
Load more