Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

easily clear a console using escape sequences

807601Feb 17 2008 — edited Feb 17 2008
I know I've been looking for a way to easily clear the console without installing a library. I just found the escape sequence for a backspace and it actually clears the screen. In some of the other topics for this same problem it seemed nobody knew about this, they were either using something else to do it or just moving down enough lines to not see the text that was printed out before.
                System.out.print("This is a test");
		for(int i=0; i<300; i++)
		{
			System.out.print("\010");
			System.out.print(" ");
			System.out.print("\010");
		}
		System.out.println();
		System.out.println("^The text is gone");
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 16 2008
Added on Feb 17 2008
0 comments
137 views