• Post Reply Bookmark Topic Watch Topic
  • New Topic

HELP with input  RSS feed

 
Ryan Johnstone
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a program where i want to get four digits from the user running from console. Also if the user hits escape i would like to exit the program. I have yet to come across something that will let me get input without hitting enter. Any help would be appreciated.
Thanks
RyanJ
 
Matt Senecal
Ranch Hand
Posts: 255
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could implement a KeyListener that listens for keystrokes and identifies them, acting when specific strokes are identified.
Originally posted by Ryan Johnstone:
I have a program where i want to get four digits from the user running from console. Also if the user hits escape i would like to exit the program. I have yet to come across something that will let me get input without hitting enter. Any help would be appreciated.
Thanks
RyanJ

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!