• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

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().
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic