Some Simple Console App Questons (Java)

Reply

Join Date: Feb 2002
Posts: 898
Reputation: Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light 
Solved Threads: 27
Moderator
Tekmaven's Avatar
Tekmaven Tekmaven is offline Offline
The C# Man, Myth, Legend

Some Simple Console App Questons (Java)

 
0
  #1
Jun 5th, 2003
1. How do you clear the screen in a console java app?

2. How do you input text in the console area? Is it something with System.in?

...There may be more later :-P
-Ryan Hoffman

.NET Specialist / Webmaster, Extended64.com.
Please do not email or PM me with support questions. Please direct them to the forums instead.
Reply With Quote Quick reply to this message  
Join Date: Jun 2004
Posts: 2,108
Reputation: server_crash is on a distinguished road 
Solved Threads: 18
server_crash server_crash is offline Offline
Postaholic

Re: Some Simple Console App Questons (Java)

 
0
  #2
Jan 14th, 2005
1) I've never done this so I'm not too clear on this. I think you have to set some kind of system property and then you can get properties of the console, and use escape sequences to clear console.

2) public class Hello
{
public static void main(String[] args)
{
System.out.println("Hello");
}
}

lol this question was posted like half a year ago, but ohh welll.
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 213
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Some Simple Console App Questons (Java)

 
0
  #3
Jan 15th, 2005
Console applications should never clear the screen. They should not even assume they have sole control over the screen below the point they're started from (for example, another application running in the background may well interrupt them to write something to the output itself, this could be the JVM writing some error message for example).
Reply With Quote Quick reply to this message  
Join Date: Jun 2004
Posts: 609
Reputation: freesoft_2000 is an unknown quantity at this point 
Solved Threads: 7
freesoft_2000 freesoft_2000 is offline Offline
Practically a Master Poster

Re: Some Simple Console App Questons (Java)

 
0
  #4
Jan 16th, 2005
Hi everyone,

The simple answer is you can't but you can do this, it's a rather stupid way but it works

  1.  
  2. void public clear ()
  3. {
  4. int i = 0;
  5.  
  6. for(i=0;i<300;i++)
  7. {
  8. System.out.println("\n");
  9. }
  10.  
  11. }

It does the trick for me

I hope this helped you

By the way do you know how to print the contents of a JTextPane??

Yours Sincerely

Richard West
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC