I am running Windows, however the program I am writing needs to be cross compatible with Linux.
I am aware that you can rewrite (or replace a already written line in the console with another) single lines in the console in both Windows/Linux just by using \r
System.out.print("Initial line");
System.out.print("\r");
System.out.print("Updated line");
but I would like to rewrite multiple lines like:
System.out.print("Line 1");
System.out.print("Line 2");
// magic code
System.out.print("Updated line 1");
System.out.print("Updated line 2");
I would guess that you use something along the lines of \b, etc but I am at a loss. Anyone know how this is done? (NO 3RD PARTY LIBRARIES)
I am afraid that is not possible. Windows documentation shows it cannot be done. I know you said no third party libraries, but would you mind trying curses. That is the only hope I see AFAIK.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With