*
The moose likes Java in General and the fly likes How to refresh the output in DOS console? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to refresh the output in DOS console?" Watch "How to refresh the output in DOS console?" New topic
Author

How to refresh the output in DOS console?

pengpeng lin
Greenhorn

Joined: Dec 24, 2005
Posts: 26
Hi all,

I have a trouble with some UI output.Here is the requirement below:

1.The program will use the DOS as UI.

2.The program will execute some important job with a background thead,alos
it must provide the monitor function by displaying some information about
the transaction every several minutes.

For example:

There are *** records in souce database
There are *** records have been inserted to the destination database
There are *** records have been failed to insert to the destination
There are *** records remain in source database

All the inforamtion above must be refreshed in every 5 minutes.

So far as I know, I could use thread to get the real information from some other class,but the most troublesome job is that :

How can I refresh the information, not "append" ! just refresh the output!

Can anyone help me!

Thanks very much!
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

You could use Ansi.sys, to move 5 lines up after printing the last:
http://academic.evergreen.edu/projects/biophysics/technotes/program/ansi_esc.htm


http://home.arcor.de/hirnstrom/bewerbung
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to refresh the output in DOS console?
 
Similar Threads
automatic refreshing
Stateless web service and caching
automatic refresh of a jsp page
Need help on Database TABLE Listener
GUI display & booking questions