Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Java: Clear the console and control attributes On Win9x

Java: Clear the console and control attributes On Win9x
{filelink=12342}

public class WindowsCLS {
  public static void main(String args[])
  {
    String ANSI_CLS = "u001b[2J";
    String ANSI_HOME = "u001b[H";
    String ANSI_BOLD = "u001b[1m";
    String ANSI_AT55 = "u001b[10;10H";
    String ANSI_REVERSEON = "u001b[7m";
    String ANSI_NORMAL = "u001b[0m";
    String ANSI_WHITEONBLUE = "u001b[37;44m";
    System.out.println(ANSI_CLS);
    System.out.println       (ANSI_AT55 + ANSI_REVERSEON + "Hi, there " + ANSI_NORMAL);
    System.out.println       (ANSI_HOME + ANSI_WHITEONBLUE + "Hello world" + ANSI_NORMAL);
    System.out.print       (ANSI_BOLD + "Press any key..." + ANSI_NORMAL);
    try {
System.in.read();
}
catch(Exception e){
}
    System.out.println(ANSI_CLS);
    }
  }

No comments yet.

Leave a Comment