Results 1 to 6 of 6
Thread: how to blank an output screen?
- 07-19-2011, 02:30 AM #1
Member
- Join Date
- Jul 2011
- Posts
- 6
- Rep Power
- 0
how to blank an output screen?
i have started working with java a week ago however i have background with JavaScript.
my problem is that i don't know how to clear the output window so:
import java.util.Scanner;
public class hi5 {
public static void main (String args[]){
Scanner A = new Scanner (System.in);
//anything is put on the output
System.out.println("anything");
//the output will be anything, however now how do i erase this line from the output box?
//in addition when u input anything
int a = A.nextInt();
//the input value u have just typed stays on the screen after you have pressed the enter
//buttom, and i would like to know how to make the input value disappear when u enter it
}
}
help would be greatly appreciated, thx
- 07-19-2011, 02:45 AM #2
Some consoles have commands to clear. On others you could write enough blank lines to push shown lines out of sight.
Otherwise consoles are not for fancy GUI like stuff. Use a GUI if you want that kind of control.
- 07-19-2011, 04:57 AM #3
- Join Date
- Dec 2010
- Location
- Stockholm, Sweden
- Posts
- 222
- Blog Entries
- 9
- Rep Power
- 3
Clearing the terminal is OS dependent, I am not sure but i think GNU's ncourses can clear the terminal, if so, the Java library jcourses may also be able to do so for Windows and GNU (Linux).
However if you are using GNU you just need to print "\033c" for clearing the screen or "\033[2J" for clearing the display (previous lines will be stored, but only visible if scrolling up).
Several commands like this (for example colouring) exists, and some of the magick follows the specifications for VT100.
If you are using Windows or DOS I hear these command does work, but for newer version of Windows (maybe it was XP and newer) you must explicitly enable ANSI.SYS,
but I do not know how to do that.Ex animo! Hibernate
Java, Arch Linux, C, GPL v3, Bash, Eclipse, Linux VT, GNOME 2 and many buttons on windows.
- 07-19-2011, 06:25 AM #4
Member
- Join Date
- Jul 2011
- Posts
- 6
- Rep Power
- 0
thx i will try to look into it more
- 08-05-2011, 02:16 AM #5
- Join Date
- Dec 2010
- Location
- Stockholm, Sweden
- Posts
- 222
- Blog Entries
- 9
- Rep Power
- 3
Please notify me by mail [hibernate@linuxmail.org] if you get it to work in Windows.
It would be awesome to get more of my stuff to work in Windows.Ex animo! Hibernate
Java, Arch Linux, C, GPL v3, Bash, Eclipse, Linux VT, GNOME 2 and many buttons on windows.
- 08-05-2011, 02:19 AM #6
- Join Date
- Dec 2010
- Location
- Stockholm, Sweden
- Posts
- 222
- Blog Entries
- 9
- Rep Power
- 3
Last edited by Hibernate; 08-05-2011 at 02:21 AM.
Ex animo! Hibernate
Java, Arch Linux, C, GPL v3, Bash, Eclipse, Linux VT, GNOME 2 and many buttons on windows.
Similar Threads
-
Applet compiles and tests fine in jGrasp... blank white screen when placed into HTML
By AlphaWhelp in forum Java AppletsReplies: 6Last Post: 07-01-2011, 03:20 AM -
Move from one screen fto other screen
By jprgmr75 in forum CLDC and MIDPReplies: 0Last Post: 01-02-2011, 06:32 PM -
Blank screen
By dewitrydan in forum New To JavaReplies: 14Last Post: 08-12-2010, 05:19 PM -
Blank space
By sandy1028 in forum New To JavaReplies: 1Last Post: 04-21-2009, 10:00 AM -
Blank Screen while navigating from one screen to another
By mohana.krishna in forum Java ServletReplies: 0Last Post: 03-03-2009, 05:03 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks