Results 1 to 2 of 2
  1. #1
    JT4NK3D's Avatar
    JT4NK3D is offline Member
    Join Date
    Nov 2007
    Posts
    50
    Rep Power
    0

    Default Press any key to continue/press enter

    How can i make the execution of my code stop and wait until the user presses any key? And if that isn't very easy, how can i make it wait until the user presses the return key? Thnx in advance.

  2. #2
    hardwired's Avatar
    hardwired is offline Senior Member
    Join Date
    Jul 2007
    Posts
    1,576
    Rep Power
    10

    Default

    Depends on what it is that you want to stop the execution of. You might be able to use a thread with a while loop and sleep delay. You can bind a key to the component and use it to interrupt the thread. Or you might be able to use wait and notify.
    Have a look at Lesson: Concurrency for some ideas.

Similar Threads

  1. simulate form type=button press with java application
    By redmoonzer01 in forum Networking
    Replies: 1
    Last Post: 03-29-2008, 07:28 AM
  2. Java Control Panel not saving changes when I press OK
    By RebelScum in forum New To Java
    Replies: 0
    Last Post: 03-21-2008, 05:22 PM
  3. Reading Char without needing to press enter
    By x0psci in forum New To Java
    Replies: 0
    Last Post: 11-23-2007, 05:28 PM
  4. enter data from an optic device
    By bbq in forum Advanced Java
    Replies: 2
    Last Post: 07-04-2007, 08:02 AM
  5. Javascript and enter button
    By Eric in forum Advanced Java
    Replies: 1
    Last Post: 06-11-2007, 09:39 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
  •