在Windows中使用Java着色文本 [英] coloring text with Java in Windows

查看:100
本文介绍了在Windows中使用Java着色文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道在Linux控制台中我们可以写这样

I knew that in Linux Console we can write something like this

System.out.println("\033[31mhello");

,因此结果将是hello(不带引号),颜色将是红色。 。

so that the result will be "hello" (without quotes) and the color will be red...

有没有办法在Windows上执行此操作?或者有什么软件可以处理窗口上完全相同的东西?

is there any way to do this on windows? or is there any software that can handle the exactly same thing on windows?

推荐答案

您可能需要一个.DLL文件正常的控制台输出在窗口。请尝试以下方法之一:

You will probably need a .DLL file to get decent console output on windows. Try one of the following:

  • Jansi
  • JLine

这篇关于在Windows中使用Java着色文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆