Results 1 to 4 of 4
  1. #1
    glina126 is offline Member
    Join Date
    Feb 2011
    Posts
    28
    Rep Power
    0

    Default automatic ENTER?

    just a quick question.

    is there any way to have user input a number, letter w.e and as soon as they input it have ENTER pressed for them automatically? just wondering. this would make my MasterMind game much better and user friendly.
    Still a newbee.. on chapter 7 of 15 in the book "Starting out with Java", by Tony Gaddis. :) (GUIs!!!! :D)

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

    Default

    It depends. For command line applications, no. (See my answer in the other thread you were posting on about ignoring key presses). Key presses are not detectable.

    For GUI applications, yes. You can register listeners on text components and respond however you like to key presses and other user input.

  3. #3
    glina126 is offline Member
    Join Date
    Feb 2011
    Posts
    28
    Rep Power
    0

    Default

    and yea, i read your answer in the other thread. i see.


    what about this line of code?

    keyboard.nextLine();

    doesnt this stop the one time auto press Enter? all i need is one time ENTER press after each variable has been entered. but i guess its not possible. thanks though! ;)
    Still a newbee.. on chapter 7 of 15 in the book "Starting out with Java", by Tony Gaddis. :) (GUIs!!!! :D)

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

Similar Threads

  1. Automatic Updates...How to stop them?
    By Otto in forum New To Java
    Replies: 5
    Last Post: 05-26-2010, 09:18 AM
  2. Automatic sign in?
    By dunafrothint in forum Networking
    Replies: 1
    Last Post: 03-26-2010, 04:00 PM
  3. SDK for automatic image correction
    By dererstetorres in forum Advanced Java
    Replies: 0
    Last Post: 09-10-2009, 09:23 PM
  4. automatic email
    By pracheebapate in forum New To Java
    Replies: 2
    Last Post: 01-18-2009, 09:07 PM
  5. automatic email
    By aswin in forum New To Java
    Replies: 0
    Last Post: 11-13-2008, 09:03 AM

Posting Permissions

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