I’m writing Java on Windows 7, and I want to be able to work with the input from the keyboard, which I can only presume is the standard input.
I’ve tried to use BufferedInput, System.in, and Scanner, but all of them require the program to pause and wait for an end of line or return! Is there anyway to just collect and record the data as it is used, and not have to wait for a return?
Here is a quick solution:
The main thread prints “test” every second. And the inputThread asks the user to type something then prints what he wrote. It’s just a “visual” solution, you certainly don’t want to print something while the user is typing.