我想在 Eclipse 控制台中用粗体编写一个字符串(只是“test.txt”)...
System.out.println("the name of the file is ? test.txt");
<小时/>
请这个解决方案Font settings for strings in java不工作!
当我这样做时:System.out.println((char)27 +“[1m 测试粗体”);
我得到:[1m 测试粗体
我使用的是 Java-8u40,因此 Eclipse Luna 使用的是 Javaw.exe ...
最佳答案
这高度依赖于控制台。使用 Eclipse 中的文本,您将无法显示粗体文本。
显示不同类型字体的更简单方法是使用 Swing 的 JTextArea 并使用 HTML格式化。
关于java - 在 Eclipse 控制台中用粗体写一个字符串?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30434415/