Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2006

Tip: Looking for answers? Try searching our database.

Clearing the output screen

Thread view: 
Colin Hemmings - 20 Feb 2006 17:48 GMT
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
Chris Smith - 20 Feb 2006 18:14 GMT
> 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
[quoted text clipped - 5 lines]
> command like:
>     System.out.println("Processing is "+x+"% complete");

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

Signature

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

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation

TheFullSP - 20 Feb 2006 20:49 GMT
You will have to use a JFrame add a scrollpane and add a textarea
you can then manipultate the textarea's text

http://javaalmanac.com/egs/javax.swing.text/pkg.html
~Glynne - 21 Feb 2006 00:20 GMT
> 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
[quoted text clipped - 9 lines]
>
> 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.