• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

another question

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok, i need to add a Press any Key to Continue to my program....i know i can do a
*****.readLine();
to get input and then use a Unicode value and get the semi-desired results, but i want the user to be able to hit any key at all just like it says... easy way out there>?
thanks in advance
adam jones
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I needed the same thing for a console app I was writing for a class.
What I settled on was:

It worked ok. The user could type until their fingers fell off and nothings happened until they pressed enter.
Paul LaBrier
 
Adam Jones
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for the reply, but what i was looking for was a press any key...i used the unicode value for enter "2324 and then just did a readLine() and it gave me the same results, but that is not what the prof wants i mean it worked just fine by me, but you know how professors are
is there just a way to pause and wait for any response at all from the keyboard?
i am very sure there has to be, but how would that be done?
thanks again for your input
adam
 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does anyone know how to do this in java? In C/C++ it is possible to do it with getchar(). InputStream's read()method blocks until the user types the <return> key at the end of a line, at which point the whole line is available for read().
 
I've got no option but to sell you all for scientific experiments. Or a tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic