I use Google Wave, and I want to emulate the ability to send messages before you actually hit the enter key.
Is there a Java equivalent to the C function _getch()
?
I use Google Wave, and I want to emulate the ability to send messages before you actually hit the enter key.
Is there a Java equivalent to the C function _getch()
?
I found a code, Equivalent function to C's “_getch()
There's no getch equivalent in java. You might as well create a GUI component and bind the keyEvent Listener.
Initially I thought of System.in.read(), but you need to get input without pressing Enter. That requires native console interaction (and console is different under every system).
So answer is "no, there is no direct analogue".
why don't you just create a variable Scanner that don't use it, the program, in anywhere.
pause0 = pause1.nextInt();
:l it seems a lot more easy... Plus you can put a message saying "Press to continue.";
This will Do the trick but i works only from command line . Not from IDE
Custom-made method in Java for getch() function of C