0

Can I have dynamic text in the default PrintStream? e.g. say I wanted to give a running report on my program's progess, is it possible to have a percentage display that changes during the opperation, rather then simply having a string that gets new numbers tacked on to the end?

I'm pretty sure I've seen other programs that run in a DOS window that display their progress dynamically, though I couldn't say now whether or not they were Java programs.

Cambot
  • 257
  • 2
  • 13
  • 1
    Use System.out.print(), and send a carriage return ('\r') at the end of the input. This will cause it to go back to the beginning of the line. You'll be scribbling over the previous output. so watch out for that. Also, this won't work in the Eclipse console -- only in a true CMD window. – Code4aliving Mar 30 '17 at 17:05
  • 1
    FYI @Brad 's idea works inside IntelliJ's run pane – Bohemian Mar 30 '17 at 17:12
  • Thanks! Damn, when I started out with computing, carriage return meant dropping down to a new line. Times changed and I didn't get the memo, it seems :p – Cambot Mar 31 '17 at 09:45

0 Answers0