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

Thread: HELP: UNABLE TO USE NON-PRINTING CHARACTERS IN A LOOP

  1. #1
    Junior Member
    Join Date
    Jun 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation HELP: UNABLE TO USE NON-PRINTING CHARACTERS IN A LOOP

    ... hi guys, i want to make a program that uses a do-while loops which breaks
    whenever a user presses the ESC-Key, my challenge is i do not know how to
    write the code representing the ESC-key. Please help me!


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: HELP: UNABLE TO USE NON-PRINTING CHARACTERS IN A LOOP

    Are you talking about using a KeyListener? Reading in from the command prompt through a Scanner? Something else?
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Junior Member
    Join Date
    Jun 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: HELP: UNABLE TO USE NON-PRINTING CHARACTERS IN A LOOP

    Quote Originally Posted by KevinWorkman View Post
    Are you talking about using a KeyListener? Reading in from the command prompt through a Scanner? Something else?
    ...yeah, something similar to that,,,,reading an input from the user using the Scanner, and the input expected is the key ESC, for the loop to break.

  4. #4
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: HELP: UNABLE TO USE NON-PRINTING CHARACTERS IN A LOOP

    Please don't post duplicate posts. I've deleted your other one.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  5. #5
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: HELP: UNABLE TO USE NON-PRINTING CHARACTERS IN A LOOP

    Write a five line program using the Scanner and see what happens when you press different keys.

  6. #6
    Junior Member
    Join Date
    Jun 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: HELP: UNABLE TO USE NON-PRINTING CHARACTERS IN A LOOP

    Quote Originally Posted by KevinWorkman View Post
    Please don't post duplicate posts. I've deleted your other one.
    ...got it, it was in the wrong area!!!

Similar Threads

  1. Strange problem printing Unicode characters
    By sophist42 in forum What's Wrong With My Code?
    Replies: 9
    Last Post: April 29th, 2011, 10:53 AM
  2. Triangle printing (for loop)
    By thirdwave in forum Loops & Control Statements
    Replies: 2
    Last Post: December 6th, 2010, 04:07 PM
  3. [SOLVED] Printing Array without printing empty elements
    By CarlMartin10 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: April 12th, 2010, 02:41 AM
  4. Unable to render printing the complete JPanel
    By Stephen Douglas in forum What's Wrong With My Code?
    Replies: 0
    Last Post: March 13th, 2010, 11:48 AM