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 4 of 4

Thread: How to make user press enter to continue in program?

  1. #1
    Junior Member
    Join Date
    Oct 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to make user press enter to continue in program?

    Hey,

    I want to stop the program to wait for input from the user. Im basically telling the user that his "blackjack" hand has busted, and to press enter to continue.

    Ive tried to do it with the Scanner class. For instance:

    String x;
    x = in.nextLine();

    It will stop and wait but you cant skip it with just a return. It has to be SOME string...

    Any suggestions on how to do this?

    Thanks!
    Last edited by BC2210; October 2nd, 2009 at 10:22 PM.


  2. #2
    Junior Member
    Join Date
    Oct 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: How to make user press enter to continue in program?

    Actually, that works...oops

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

    Default Re: How to make user press enter to continue in program?

    is it done sir?

  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: How to make user press enter to continue in program?

    ohw sori.. i didnt notice the solved mark

Similar Threads

  1. Libraries for User Tracking
    By jwpa in forum The Cafe
    Replies: 4
    Last Post: August 4th, 2009, 09:32 AM
  2. Replies: 1
    Last Post: July 28th, 2009, 02:15 AM
  3. Replies: 9
    Last Post: June 27th, 2009, 04:05 PM
  4. Java program to write game
    By GrosslyMisinformed in forum Paid Java Projects
    Replies: 3
    Last Post: January 27th, 2009, 03:33 PM
  5. Java algorithm for bank program to connect database
    By araujo3rd in forum Algorithms & Recursion
    Replies: 1
    Last Post: December 10th, 2008, 01:34 PM