Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Press any key to continue.... in java!!!!!!

807606Apr 12 2007 — edited Apr 12 2007
Im trying to get java to pause in the command prompt, but i want it to continue as soon as any key has been pressed not must pres enter key to continue...

public static String readString()
{
try
{
inputLine = reader.nextLine();
}
catch (Exception exc)
{
printError(IO_ERROR_MESSAGE + exc.getMessage());
}
return inputLine;
}

this will work but you must press enter and just disregard whats returned, i want it to display a message and then wait for keyboard input, but to act as enter has been hit not matter what key was pressed, please please please help :|
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 10 2007
Added on Apr 12 2007
4 comments
869 views