Results 1 to 2 of 2
  1. #1
    iamBevan is offline Member
    Join Date
    Oct 2012
    Posts
    2
    Rep Power
    0

    Default Press enter to continue...

    Hi, I'm trying to put make my program wait for the user to press enter. I've tried:

    for(int i = 0; i < 100; i++){

    System.out.println("Loop number: " + i+1);
    System.out.println("Please press enter to continue: ");

    in.nextLine();
    }

    Could someone point me in the right direction? Thanks.

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

    Default Re: Press enter to continue...

    There's no need for that for loop as just the in.nextLine() should be sufficient. If this doesn't work for you, then we will probably need to know more about your program.

Similar Threads

  1. Press enter to continue
    By dharav in forum New To Java
    Replies: 6
    Last Post: 01-16-2012, 07:06 AM
  2. Press enter to continue (Jpanel)
    By david522 in forum New To Java
    Replies: 10
    Last Post: 05-22-2011, 03:40 PM
  3. press any key to continue
    By dotnet007 in forum New To Java
    Replies: 3
    Last Post: 05-11-2008, 05:19 AM
  4. Press any key to continue/press enter
    By JT4NK3D in forum New To Java
    Replies: 1
    Last Post: 11-17-2007, 09:27 PM

Posting Permissions

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