Results 1 to 8 of 8
  1. #1
    Join Date
    Sep 2011
    Location
    India
    Posts
    67
    Rep Power
    0

    Default clear screen in java

    how we clear console screen in java during running the program?

  2. #2
    Join Date
    Sep 2011
    Location
    India
    Posts
    67
    Rep Power
    0

    Default Re: clear screen in java

    class sample
    {
    public static void main(String args[])
    {

    System.out.println("Sunny");

    System.out.println("Bunny");
    System.out.println("Sekhar");
    }
    }
    -------------------->After printing sunny and bunny i want to clear the screen,. so, how we clear the screen ?

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: clear screen in java

    Java Code:
    int enoughLines = 50; // or whatever is needed
    
    for (int i = 0; i < enoughLines; i++) {
       System.out.println();
    }

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,526
    Blog Entries
    7
    Rep Power
    20

    Default Re: clear screen in java

    @OP: you really don't believe me do you. You asked the same question here and I gave you the answer several times; what do you expect, a miracle or something?

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

  6. #6
    Join Date
    Sep 2011
    Location
    India
    Posts
    67
    Rep Power
    0

    Default Re: clear screen in java

    Sory for repeating the same query... but my main theme is that i want to clear my screen while iam running the program.
    that's y iam repeating.... sory for inconvience..
    Bye.

  7. #7
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,526
    Blog Entries
    7
    Rep Power
    20

    Default Re: clear screen in java

    Reread my answer I gave in your other thread; it's the best you can do.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  8. #8
    Join Date
    Sep 2011
    Location
    India
    Posts
    67
    Rep Power
    0

Similar Threads

  1. is there any method for clear screen?
    By chandrasekhar.melam in forum New To Java
    Replies: 9
    Last Post: 09-22-2011, 08:32 PM
  2. clear screen prompt using java code
    By krunalpatel1410 in forum Advanced Java
    Replies: 9
    Last Post: 04-04-2009, 12:47 AM
  3. Need For Clear Screen
    By adithya4u4ever in forum New To Java
    Replies: 8
    Last Post: 03-08-2009, 08:41 AM
  4. Clear Screen in Console based programs
    By kirly in forum New To Java
    Replies: 5
    Last Post: 02-05-2009, 05:59 AM
  5. Clear screen in java
    By lenny in forum New To Java
    Replies: 1
    Last Post: 07-30-2007, 09:43 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
  •