Re: Can we do this with println?
- From: Joshua Cranmer <Pidgeot18@xxxxxxxxxxxxxxx>
- Date: Mon, 29 Oct 2007 21:42:57 GMT
neelsmail@xxxxxxxxxxxxxx wrote:
In the diagram above as 'X' is any character and the remaining one is
a subscript (01, 02, 03 and so on..). What I want to do then is write
the character to the screen in the subscript order X01, X02 and so
on.. The problem is I do not get how using "System.out.println" I can
go one line above without erasing the whole screen. Of course this is
_not_ a homework but something I am trying to do nevertheless.
In an ANSI-compliant terminal (i.e., pretty much anything other than Window's Command Prompt), the following string, when printed out, will print "XXX" at the top of the screen:
"\u001B[1;1HXXX"
(see <http://en.wikipedia.org/wiki/ANSI_escape_code> for other examples)
--
Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald E. Knuth
.
- Follow-Ups:
- Re: Can we do this with println?
- From: Roedy Green
- Re: Can we do this with println?
- References:
- Can we do this with println?
- From: neelsmail
- Can we do this with println?
- Prev by Date: Logging when developing Web apps under NetBeans
- Next by Date: File Open dialog bug in 1.6.0_03
- Previous by thread: Re: Can we do this with println?
- Next by thread: Re: Can we do this with println?
- Index(es):