Clearing the output screen

C

Colin Hemmings

Can anybody tell me if there is a way to clear the output screen. I am
making a basic low level program (just to improve my java skill) and I
am writing a lot of commands like:
System.out.println("There are "+x+" intems in the list");

So I was wondering if there is a way to clear the output screen, just to
make it look neater, or is there a way to clear a line so I can loop a
command like:
System.out.println("Processing is "+x+"% complete");

To show what percentage of work has been done.


Thank you kindly for your time
 
C

Chris Smith

Colin Hemmings said:
Can anybody tell me if there is a way to clear the output screen. I am
making a basic low level program (just to improve my java skill) and I
am writing a lot of commands like:
System.out.println("There are "+x+" intems in the list");

So I was wondering if there is a way to clear the output screen, just to
make it look neater, or is there a way to clear a line so I can loop a
command like:
System.out.println("Processing is "+x+"% complete");

Google "jcurses". You can't do what you're looking for with the
standard library.

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
G

~Glynne

Colin said:
Can anybody tell me if there is a way to clear the output screen. I am
making a basic low level program (just to improve my java skill) and I
am writing a lot of commands like:
System.out.println("There are "+x+" intems in the list");

So I was wondering if there is a way to clear the output screen, just to
make it look neater, or is there a way to clear a line so I can loop a
command like:
System.out.println("Processing is "+x+"% complete");

To show what percentage of work has been done.


Thank you kindly for your time

How about over-writing the current line during the loop, e.g.
System.out.print(" \r");
System.out.print("Processing is "+x+"% complete \r");

~Glynne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top