如何在 Scala 或 Java 的控制台输出中使用颜色?
如何在 Scala 或 Java 的控制台输出中使用颜色?
How to use colours in console output in Scala or Java?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
如何在 Scala 或 Java 的控制台输出中使用颜色?
How to use colours in console output in Scala or Java?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
尝试...
好吧,好吧,文字变成了蓝色。诚实的!
你可以看到背景是,嗯,黄色。
Try...
OK, well, the text has gone blue. Honest!
And you can see the background is, um, yellow.
只是为了扩展 oxbow_lakes 的答案:在 scala 2.9.2 解释器中,我必须显式打印蓝色字符串:
Just to extend the answer from oxbow_lakes: in scala 2.9.2 interpreter I had to explicitly print the BLUE string:
示例代码来自 JavaWorld
访问上面的内容链接以获取更多详细信息和方法。
Sample code from JavaWorld
Visit the above link for more details and approaches.