我想在命令行 Java 程序中添加进度指示器.
I'd like to add a progress indicator to a command-line Java program.
例如,如果我使用 wget,它会显示:
For example, if I'm using wget, it shows:
71% [===========================> ] 358,756,352 51.2M/s eta 3s
是否有可能在不添加新行的情况下更新进度指示器?
Is it possible to have a progress indicator that updates without adding a new line to the bottom?
谢谢.
首先写的时候不要使用writeln().使用写().其次,您可以使用 "来回车而不使用 ,这是一个换行符.回车应该让你回到行首.
First when you write, don't use writeln(). Use write(). Second, you can use a " " to Carriage Return without using which is a New line. The carriage return should put you back at the beginning of the line.
这篇关于Java:在命令行中更新文本而无需换行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
上传进度侦听器未触发(Google 驱动器 API)Upload progress listener not fired (Google drive API)(上传进度侦听器未触发(Google 驱动器 API))
使用 Google Drive SDK 将文件保存在特定文件夹中Save file in specific folder with Google Drive SDK(使用 Google Drive SDK 将文件保存在特定文件夹中)
Google Drive Android API - 无效的 DriveId 和 Null ResourcGoogle Drive Android API - Invalid DriveId and Null ResourceId(Google Drive Android API - 无效的 DriveId 和 Null ResourceId)
谷歌驱动api服务账户查看上传文件到谷歌驱动使Google drive api services account view uploaded files to google drive using java(谷歌驱动api服务账户查看上传文件到谷歌驱动使用java
Google Drive 服务帐号返回 403 usageLimitsGoogle Drive service account returns 403 usageLimits(Google Drive 服务帐号返回 403 usageLimits)
com.google.api.client.json.jackson.JacksonFactory;Google Drcom.google.api.client.json.jackson.JacksonFactory; missing in Google Drive example(com.google.api.client.json.jackson.JacksonFactory;Google Drive 示例