Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 11 of 11

Thread: clear screen.

  1. #1
    Java kindergarten chronoz13's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    659
    Thanks
    177
    Thanked 30 Times in 28 Posts

    Default clear screen.

    i want to ask.. what method does java has like
    the method that we used to declare in C that clears a screen conolse... (clrscr())


    coz im writing a program right now.. and i wrote a temporary block of code.. that show the value
    of my objects.. (just for checking)

    its just that i want to write a command that can clear a the screen while the program is running..
    instead of re-executing the program again and again


  2. #2
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,895
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: clear screen.

    Unfortunately, Java doesn't have a clear screen equivalent command. The only choices are JNI, or simply outputting a lot of new-lines to have a pseudo-cleared screen.

  3. #3
    Senile Half-Wit Freaky Chris's Avatar
    Join Date
    Mar 2009
    Posts
    834
    My Mood
    Cynical
    Thanks
    7
    Thanked 105 Times in 90 Posts

    Default Re: clear screen.

    clrscr() is not standard C! Do not use it! If you want a solution, then here is a Windows only Solution, this is why you just don't do it!

    Chris
    Attached Files Attached Files

  4. #4
    Java kindergarten chronoz13's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    659
    Thanks
    177
    Thanked 30 Times in 28 Posts

    Default Re: clear screen.

    oh sorry for that chris....

  5. #5
    Senile Half-Wit Freaky Chris's Avatar
    Join Date
    Mar 2009
    Posts
    834
    My Mood
    Cynical
    Thanks
    7
    Thanked 105 Times in 90 Posts

    Default Re: clear screen.

    Chronoz are you at university?

  6. #6
    Java kindergarten chronoz13's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    659
    Thanks
    177
    Thanked 30 Times in 28 Posts

    Default Re: clear screen.

    no chris... im just in a an institute... informatics.. institute... branch of an acedemy

  7. #7
    Senile Half-Wit Freaky Chris's Avatar
    Join Date
    Mar 2009
    Posts
    834
    My Mood
    Cynical
    Thanks
    7
    Thanked 105 Times in 90 Posts

    Default Re: clear screen.

    Ah ok then

    You have a teacher that says Allgorhythm too

    Chris

  8. #8
    Java kindergarten chronoz13's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    659
    Thanks
    177
    Thanked 30 Times in 28 Posts

    Default Re: clear screen.

    ahh you mean my signature? ahhh.. its just my own idea... coz i have a liitle musical background.. ahhahahaha

  9. #9
    Java kindergarten chronoz13's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    659
    Thanks
    177
    Thanked 30 Times in 28 Posts

    Default Re: clear screen.

    ahh anyway chris.. how can i import those files that you gave me .. after i extract it?

    in what particular folder should i put each of those files?

  10. #10
    Senile Half-Wit Freaky Chris's Avatar
    Join Date
    Mar 2009
    Posts
    834
    My Mood
    Cynical
    Thanks
    7
    Thanked 105 Times in 90 Posts

    Default Re: clear screen.

    Stick the dll and the class files in the same folder as your class then just call Console.clr();


    Chris

  11. #11
    Java kindergarten chronoz13's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    659
    Thanks
    177
    Thanked 30 Times in 28 Posts

    Default Re: clear screen.

    tnx chris!!!!!!!!!!! hehehe

Similar Threads

  1. Need help understanding GUI screen layouts and labels
    By Bill_H in forum AWT / Java Swing
    Replies: 3
    Last Post: December 2nd, 2009, 11:50 PM
  2. Help - Return to menu screen
    By throzen in forum What's Wrong With My Code?
    Replies: 2
    Last Post: November 29th, 2009, 01:44 PM
  3. Content positioning on the screen
    By Drakenmul in forum AWT / Java Swing
    Replies: 1
    Last Post: July 27th, 2009, 09:02 AM
  4. Java program for remote host screen capture
    By krishnaraoveera1294 in forum Java Networking
    Replies: 1
    Last Post: March 13th, 2009, 04:53 AM
  5. Replies: 3
    Last Post: November 15th, 2008, 07:17 AM