Unfortunately, there is no equivalent \r that moves the cursor up. However, this can be done using ANSI escape sequences if you can assume that you are using an ANSI compatible terminal.
To print your progress bars using ANSI codes you can do
System.out.printf(((char) 0x1b) + "[1A\r" + "Item 1: %d ", progress1); System.out.printf(((char) 0x1b) + "[1B\r" + "Item 2: %d ", progress2);
The only problem with ANSI codes is that although almost all terminals use ANSI codes, the Win32 terminal does not work . I have not tested it, but this library looks good if you need to support the built-in Windows terminal as well. It includes a JNI library that will do equivalent things on a Windows terminal, and will automatically decide whether to use the JNI library or ANSI codes. It also has some methods to simplify the use of ANSI codes.
source share