Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Clear Screen

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would any one mind helping me with one doubt.
How do you print something on to the Dosprompt and
then it should clear the screen and print something
else.
 
Marshal
Posts: 15887
265
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I haven't tried this myself but this page http://204.56.132.222/Courses/CIS415L/ANSIsys.htm may have the information you need. You need the ANSI.SYS device driver loaded then I suppose you could System.out.print <ESC>[2J

------------------
Junilu Lacar
Sun Certified Programmer for the Java� 2 Platform
 
Anju Aravind
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Junilu Lacar
That was not very clear.
Let me explain a bit more what exactly i want.
if you need to write a program to print the time and it should change on the dosprompt as the time changes ie; i want to clear the screen and print the new time each sec . What is the code for that.
Thanks a lot for your help
Anju Aravind
 
Sheriff
Posts: 9099
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out this thread
 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi there,
i read your question,even though i do not have that much knowledge of java just a begginer but can give you a idea.try double dimenssional array & in that use the ASCII code for space n print it column n row wise & try to print space on DOS PROMPT as the printing of spaces column wise &row wise comes to end,the statement whatever you wish to print ,would be printed.
i hope this would solve your problem.
kumar abhay
 
Anju Aravind
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much guys. that was exactly what I was looking for

Anju Aravind
 
Because those who mind don't matter and those who matter don't mind - Seuss. Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic