我想在java执行过程中可以实现清屏,代码如下::BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
System.out.println("\n\n" + "按回车继续.....");
stdin.readLine();
Process process = Runtime.getRuntime().exec("cmd.exe /c cls");为什么不能执行清屏命令呢?
请各位帮忙改一下。
System.out.println("\n\n" + "按回车继续.....");
stdin.readLine();
Process process = Runtime.getRuntime().exec("cmd.exe /c cls");为什么不能执行清屏命令呢?
请各位帮忙改一下。
改成
Process process = Runtime.getRuntime().exec("cmd.exe /c start dir");
它执行了,不过是打开一个新的窗口,我想在本窗口内执行清屏命令,该如何操作。
如果我要在本窗口内执行该如何操作。
要在原窗口上清屏,如果是vc的话,得到该窗口的句柄就可以了,而对于java来说这个比较困难。
System.out.println("");肯定能清屏.