在BlueJ/Java中更改system.out字体和颜色 [英] Changing the system.out font and color in BlueJ/Java

查看:401
本文介绍了在BlueJ/Java中更改system.out字体和颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个非常简单的代码

Here is a very simple code

public class test
{
    public static void main(String[] args)
    {


    System.out.println("  Hello ");



    }
}

我正在使用BlueJ IDE. 我要做的是使打印输出的颜色为红色. 并将字体更改为任何自定义字体-说Arial Unicode MS.

I am using a BlueJ IDE. What I want to do is make the color of the printed output red. And change the font to any custom made font - say Arial Unicode MS.

如有需要,请随时对上面的代码进行更改或提供详细说明. 预先感谢.

Feel free to make changes to the code above or give detailed instructions if other things are required. Thanks in advance.

BlueJ似乎使用写字板作为控制台.就是说,将输出引导到写字板/记事本中.这是否意味着我还必须做些其他事情?

BlueJ seems to use a wordpad as a console. That is it Channels the output into wordpad/notepad. Does this mean I have to something else?

还是我应该尝试更改的bluej.defs文件?

Or is it the bluej.defs file where I should try changing?

推荐答案

您可以将其更改为

System.err.println("   Hello ") 

它将以红色打印,但是"err"通常用于打印错误消息,因为您可能已经猜到了.

it will print in red color but "err" is usually used to print an error message as you may have already guessed.

我认为您不能从Java代码中更改控制台字体的颜色和属性.但是,您可以尝试摆弄BlueJ应用程序中的设置,看看是否可以通过这种方式进行更改.换句话说,这取决于显示输出的主机.

I don't think you can change console font colors and attributes from within the java code. However you can try fiddling around the setting in the BlueJ app and see if you can change it that way. In other words, it depends on the host thats displaying the output.

这篇关于在BlueJ/Java中更改system.out字体和颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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