开发者

Netbeans and DOS-style progress bar

开发者 https://www.devze.com 2023-02-26 21:18 出处:网络
I am writing a command-line applicat开发者_如何学编程ion which shows its progress by printing something like \"%d%% complete\\r\", so the cursor gets to the beginning of the same line, not the next on

I am writing a command-line applicat开发者_如何学编程ion which shows its progress by printing something like "%d%% complete\r", so the cursor gets to the beginning of the same line, not the next one. But when I run it in Netbeans, output window does not work like DOS one and I get a flood of progress status messages into there. Is there a way to move a cursor back to the same line in Netbeans output window?


The pragmatic solution is to use a progress bar instead. Something in the lines of System.out.print("-");


Netbeans output window is just a Swing component. It is not a terminal window, and you will notice that your Java app does not have a Console either. Netbeans does offer a beta Terminal window thing (Window -> Output -> Terminal) but you will need to type the proper commandlines manually to run your program through that.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号