简体   繁体   English

控制台中有静态线路

[英]Have static lines in console

I am wondering how to in Java set up the console so the first couple lines in the console will always be there and contain info about the program. 我想知道如何在Java中设置控制台,以便控制台中的前几行始终存在,并包含有关程序的信息。 So for example I would want the progam to display the first line in the console as: JavaProgram Version: 0.5b 因此,例如,我希望程序在控制台中将第一行显示为:JavaProgram Version:0.5b

and even if the console spams new lines that line will stay at the top. 即使控制台向新行发送了垃圾邮件,该行仍将停留在顶部。 Another good example would be how cgminer shows the most relevant data at the top. 另一个很好的例子是cgminer如何在顶部显示最相关的数据。

My initial approach for tackling this issue would be to create a loop that every tick send enough lines to exactly fill the console size; 解决此问题的最初方法是创建一个循环,使每个刻度线都发送足够的行以完全填满控制台大小。 however, I do not know if it is possible to get the console height. 但是,我不知道是否有可能获得控制台高度。

Any help would be awesome! 任何帮助都是极好的!
Thank you, 谢谢,
Kyle 凯尔

That is what the Curses family of libraries is all about; 这就是Curses图书馆家族的全部宗旨 so I'd use Java Curses Library , 所以我会用Java Curses Library

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM