[Bluej-discuss] "Backspace" escape character
TJ Evert
tjevert at gmail.com
Fri Jan 11 14:53:14 GMT 2008
Dear all,
My class and I are writing methods that act on Strings and (in the past)
I've used the "\b" escape character for an "untype()" method (which uses a
delay() method) as follows:
public static void untype(String str)
{
int len = str.length();
System.out.print(str);
for(int i = 0; i < len; i++)
{
delay(1000);
System.out.print("\b \b");
}
}
public static void delay(long milliSeconds)
{
long now = System.currentTimeMillis();
long later = now + milliSeconds;
while(later > now)
{
now = System.currentTimeMillis();
}
}
The problem is that BlueJ types out a "box" character. Any thoughts?
TJ Evert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.bluej.org/pipermail/bluej-discuss/attachments/20080111/8bff4a86/attachment.html
More information about the bluej-discuss
mailing list