【发布时间】:2020-06-02 06:24:12
【问题描述】:
我这里有一个程序,它只包括扫描仪和输出。我希望程序显示的是显示具有以下输出的扫描仪。
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.print("Enter anything: ");
scan.nextLine();
//while the scanner's text cursor shows, the bottom texts below also shows.
System.out.println("bottom text");
System.out.println("bottom text");
System.out.println("bottom text");
System.out.println("bottom text");
System.out.println("bottom text");
System.out.println("bottom text");
System.out.println("bottom text");
/* what I wanted the output to show is this:
Enter anything: | << text cursor
bottom text
bottom text
bottom text
bottom text
bottom text
bottom text
bottom text
but the output shows like this instead:
Enter anything: |
*/
}//end of method
}
因为它只在使用扫描仪后显示下面的输出。是否有可能或有什么方法可以同时显示扫描仪和底部文本? TIA :)
【问题讨论】:
-
我认为这应该可以使用 VT100 代码
-
@Sadap 感谢您的提示,我对其进行了研究,它可能对显示有所帮助。
标签: java output java.util.scanner