Results 1 to 3 of 3
  1. #1
    pauser is offline Member
    Join Date
    Apr 2010
    Posts
    7
    Rep Power
    0

    Default Output in terminal !

    Hi!

    How can I make a output every time change.
    F.e.

    try{
    for(int i=0; i<6; i++){
    System.out.println("Test "+(i+1));
    Thread.sleep(1000);
    }
    }catch(Exception e){...}
    this makes for every i another line.
    I want to make it change itself, like % of downloaded in Linux-terminal,
    I wanna have in the same line after 1 sec another content !
    Last edited by pauser; 11-29-2010 at 07:08 PM. Reason: QUOTE

  2. #2
    Singing Boyo is offline Senior Member
    Join Date
    Mar 2009
    Posts
    552
    Rep Power
    6

    Default

    try using System.out.print("Test " + (i+1) + "\r"); The carriage return should move back to the start of the line. This question and the answers to it have useful info as well.
    If the above doesn't make sense to you, ignore it, but remember it - might be useful!
    And if you just randomly taught yourself to program, well... you're just like me!

  3. #3
    pauser is offline Member
    Join Date
    Apr 2010
    Posts
    7
    Rep Power
    0

    Default

    Quote Originally Posted by Singing Boyo View Post
    try using System.out.print("Test " + (i+1) + "\r"); The carriage return should move back to the start of the line. This question and the answers to it have useful info as well.
    Man, it really worked. I did not check println() at first !
    Last edited by pauser; 11-29-2010 at 08:02 PM.

Similar Threads

  1. output to terminal instead of console on mac
    By firen in forum Advanced Java
    Replies: 0
    Last Post: 06-01-2010, 12:42 PM
  2. Mac Terminal
    By Java8 in forum Other IDEs
    Replies: 0
    Last Post: 01-16-2010, 06:19 PM
  3. Terminal
    By dj kourampies in forum New To Java
    Replies: 7
    Last Post: 01-07-2009, 03:57 PM
  4. VT6530 Terminal Emulator 0.2.2
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 03-01-2008, 10:18 PM
  5. Problem when displays in the terminal
    By Felissa in forum Advanced Java
    Replies: 2
    Last Post: 07-01-2007, 02:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •