• Post Reply Bookmark Topic Watch Topic
  • New Topic

Any way to clear screens in java  RSS feed

 
Gaurav Chikara
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have not found any way of doing it
I tried RunTime.exec("cls");
but gave runtime exception
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you be more specific? Which RunTime exception was thrown? What was the error message? What Operating System do you use? What type of application are you writing (e.g. Text, GUI, JSP, etc.)?
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Making some dangerous leaps here - assuming you are running a 'console' style program, command window, stdin and stdout? On Windows?
If so, you may be able to use ANSI Control Characters. I haven't tried it from Java, but it's just stdout so it ought to work.
This is very old-fashioned from the days of DOS Batch and GW-Basic - 1980s. Windows only, but free & easy.
Here's a Text UIpackage I found on Google. Went looking for curses but couldn't find it for Java in a few seconds.
 
Dirk Schreckmann
Sheriff
Posts: 7023
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!