清除屏幕 [英] Clear the Screen

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

问题描述




我做了一些研究,尝试用java代码清除屏幕。


第一个选项是obv :

system.out.print(" \\\\\\\\\\\\ n然后我听说这个方法:

System.out.print((char)27 +" [2J") ;


但是,除非ansi.sys,否则它不起作用。加载了很少的WinXP

用户有这个。


尝试解决这个问题的任何帮助。

干杯,

Dave

Hi,

I have done some research, trying to Clear The Screen in java code.

The first option was the obv:
system.out.print("\n\n\n\n\n\n\n\n\n\n\n\n");

then i heard about this method:
System.out.print((char)27 + "[2J");

However, it doen''t work unless "ansi.sys" is loaded and very few WinXP
user''s have this.

Any help appreciated in trying to solve this problem.

Cheers,
Dave

推荐答案

这是一种黑客攻击,但是这个怎么样:


Runtime.exec(" cls");


这使您的应用程序依赖于平台,但它看起来像你的/>
声明替代方案也是如此。


- Nathan


" Dave" < bigdavepotnoodle * SPAM * hotmail.com>在消息新闻中写道:< 3f *********************** @ news-text.dial.pipex.com> ...
It''s kind of a hack, but what about this:

Runtime.exec("cls");

This makes your application platform-dependent, but it looks like your
stated alternative does this as well.

-Nathan

"Dave" <bigdavepotnoodle*SPAM*hotmail.com> wrote in message news:<3f***********************@news-text.dial.pipex.com>...


我做了一些研究,尝试用java代码清除屏幕。

第一个选项是obv:
system.out .print(" \\\\\\\\\\\\ n; \\ n; \\ n;
System.out.print((char)27 +[2J];

然而,除非它不起作用 ANSI.SYS"加载了很少的WinXP
用户都有这个。

任何帮助都试图解决这个问题。

欢呼,
戴夫
Hi,

I have done some research, trying to Clear The Screen in java code.

The first option was the obv:
system.out.print("\n\n\n\n\n\n\n\n\n\n\n\n");

then i heard about this method:
System.out.print((char)27 + "[2J");

However, it doen''t work unless "ansi.sys" is loaded and very few WinXP
user''s have this.

Any help appreciated in trying to solve this problem.

Cheers,
Dave



我之前看过这个问题 - 没有真正的解决方案。

当然,提供一个清晰的屏幕并不困难,甚至

基本的屏幕光标定位?

它会使文本模式java更有用。


Dave < bigdavepotnoodle * SPAM * hotmail.com>在消息中写道

新闻:3f *********************** @ news-text.dial.pipex.com ...
Ive seen this question before- with no real solution.
Surely it wouldnt have been difficult to provide a clear screen, and even
basic screen cursor positioning?
It would make text-mode java alot more useful.

"Dave" <bigdavepotnoodle*SPAM*hotmail.com> wrote in message
news:3f***********************@news-text.dial.pipex.com...


我做了一些研究,尝试用java代码清除屏幕。

第一个选项是obv:
system.out.print(" \\\\\\\\\\\\ br />
然后我听说了这个方法:
System.out.print((char)27 +" [2J"];

然而,它确实''除非ansi.sys,否则不起作用加载了很少的WinXP
用户都有这个。

任何帮助都试图解决这个问题。

欢呼,
戴夫
Hi,

I have done some research, trying to Clear The Screen in java code.

The first option was the obv:
system.out.print("\n\n\n\n\n\n\n\n\n\n\n\n");

then i heard about this method:
System.out.print((char)27 + "[2J");

However, it doen''t work unless "ansi.sys" is loaded and very few WinXP
user''s have this.

Any help appreciated in trying to solve this problem.

Cheers,
Dave





" Dave" < bigdavepotnoodle * SPAM * hotmail.com>在消息中写道

新闻:3f *********************** @ news-text.dial.pipex.com ...

"Dave" <bigdavepotnoodle*SPAM*hotmail.com> wrote in message
news:3f***********************@news-text.dial.pipex.com...


我做了一些研究,尝试用java代码清除屏幕。

第一个选项是obv:
system.out.print(" \\\\\\\\\\\\ br />
然后我听说了这个方法:
System.out.print((char)27 +" [2J"];

然而,它确实''除非ansi.sys,否则不起作用加载了很少的WinXP
用户都有这个。

任何帮助都试图解决这个问题。

欢呼,
戴夫
Hi,

I have done some research, trying to Clear The Screen in java code.

The first option was the obv:
system.out.print("\n\n\n\n\n\n\n\n\n\n\n\n");

then i heard about this method:
System.out.print((char)27 + "[2J");

However, it doen''t work unless "ansi.sys" is loaded and very few WinXP
user''s have this.

Any help appreciated in trying to solve this problem.

Cheers,
Dave




在sourceforge上查看jcurses。


Silvio Bierman



Look at jcurses on sourceforge.

Silvio Bierman


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

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