如何清除Java控制台? [英] How do you clear the Java Console?

查看:249
本文介绍了如何清除Java控制台?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的输出讯息显示在 Java控制台,用于使用webstart启动的应用程序。

I have output messages displayed on the Java console for an application that started using webstart. Instead of the user manually clearing message, is there a way of clearing console messages in code?

这些消息是以每秒大约1000次的速度打印的,似乎结束了,而不是用户手动清除消息。

These messages are printed at the rate of about 1000 per second and seem to end up using too much memory, i could have stopped the printing to console, but the requirement is to always have it.

推荐答案

你可以使用太多的内存,我可以停止打印到控制台。将无法清除该控制台,除非您在该控制台的类中找到一些句柄(我怀疑你可以访问)。

You will not be able to clear that console, unless you find some handle on the classes for that console (which I doubt you would have access to).

有不可避免的要求,用户将需要进入和手动清除控制台每几分钟。
我认为这需要重新思考为什么需求存在,并且有另一个解决方案来解决你的问题。

The requirement you have has the inevitable requirement that the user will need to go in and manually clear the console every couple of minutes. I think that justifies a rethink about why the requirement exists and wether there is another solution to solve your problem.

你考虑过不同的日志记录方式吗?

Have you considered a different way of logging?

这篇关于如何清除Java控制台?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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