2009-07-30 81 views

回答

0

不是直接。在过去,ANSI转义序列被支持,但现在不再有了。

我建议你看看一个很好的支持Windows的Java Curses库。我不能推荐任何:(

3

你通常不使用的System.out做这些事情。在* nix中使用NCURSES大多数应用(http://en.wikipedia.org/wiki/Ncurses)这一点。你可以尝试http://sourceforge.net/projects/javacurses/如果你需要的东西此智能。

但是,您可以随时SYSOUT退格(\ b)如果你想删除你想要什么,最好

+0

我同意@Nir Levy。不过考虑一下,这看起来很老旧,但可能是一些快速的一次性安装界面。然后,我不知道你的约束是什么。如果可能的话,考虑awt,swing或[swt](http://eclipse.org/swt/) – Miquel 2011-12-07 14:27:37

1

哈希望的字符,你仍然可以做到这一点在Linux上。 参考的代码本身这名男子页 http://man7.org/linux/man-pages/man4/console_codes.4.html

public class quickTest{ 
    public static void main(String[] args){ 
      //This will undo the current line by erasing it 
      //and then putting the curser back at column 1 
     System.out.println("Hello.\u001b[1K\u001b[1GHi."); 
    } 
}