| | |
Some Simple Console App Questons (Java)
![]() |
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
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.
.NET Specialist / Webmaster, Extended64.com.
Please do not email or PM me with support questions. Please direct them to the forums instead.
•
•
Join Date: Jun 2004
Posts: 2,108
Reputation:
Solved Threads: 18
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.
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.
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).
•
•
Join Date: Jun 2004
Posts: 609
Reputation:
Solved Threads: 7
Hi everyone,
The simple answer is you can't but you can do this, it's a rather stupid way but it works
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
The simple answer is you can't but you can do this, it's a rather stupid way but it works
Java Syntax (Toggle Plain Text)
void public clear () { int i = 0; for(i=0;i<300;i++) { System.out.println("\n"); } }
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
![]() |
Similar Threads
- Transparent Console APP (C++)
- Console App? (C#)
- console app + forms (VB.NET)
- Help make Console App Open in fullscreen. (C++)
Other Threads in the Java Forum
- Previous Thread: Looking for J2ME audio or video player
- Next Thread: I've tried everything...setting font of selected text
| Thread Tools | Search this Thread |
2dgraphics account android api apple applet application array arrays automation banking bidirectional binary binarytree birt bluetooth chat chatprogramusingobjects class client code columns component database derby design designadrawingapplicationusingjavajslider eclipse encryption error errors expand fractal game givemetehcodez graphics gui homework html ide if_statement image inheritance integer intellij interface j2me java javadesktopapplications javaprojects jlabel jme jni jpanel jtextfield julia linux list map method methods midlethttpconnection mobile mobiledevelopmentcreatejar monitoring netbeans newbie nullpointerexception open-source problem program programming project property recursion reference ria scanner search server set sms sort sourcelabs splash sql sqlite static stop string subclass support swing testautomation threads tree ui unicode validation windows






