we all know that to input a string we need to press enter in java. But how can one detect or check what is written on the console before the enter button is pressed? For example, I have typed "hello" on the console but not pressed enter, how can I print "hello" just by detecting what is written on the console?
Using java frame (swing) this is easy as you can detect what you've written in the testfield by tf.getText, same thing I want to do on the console. Please help
while(true){
print(detect_console_string())
wait(5000); // milliseconds
}
Please help with this