Results 1 to 4 of 4
  1. #1
    romero4742 is offline Member
    Join Date
    Mar 2012
    Posts
    27
    Rep Power
    0

    Question Press any key to continue

    Hey guys so I am working on a little project and wanted to add a feature that would pause the program and resume when any key is typed.
    The "Enter" key is obvious but I don't know how to do it for "any" key. Any help is appreciated thanks.

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default Re: Press any key to continue

    Java command line applications don't support this.

    With Swing (graphical) applications you can arrange to be notified of keys being pressed or typed, although in a graphical application a button would be the natural choice.

  3. #3
    romero4742 is offline Member
    Join Date
    Mar 2012
    Posts
    27
    Rep Power
    0

    Default Re: Press any key to continue

    Java command line applications don't support this.
    So there is no way to do this in java?

  4. #4
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,755
    Rep Power
    7

    Default Re: Press any key to continue

    Did you read the above reply?

    You cannot do it with a command line app but you can do it with a GUI.
    If it is a command line app simply have the program pause for user input. The only draw back is that the user must hit enter.

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. [SOLVED] Press any key to continue??
    By jon80 in forum New To Java
    Replies: 4
    Last Post: 06-15-2009, 11: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

Tags for this Thread

Posting Permissions

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