I am working on a project in which I have to write a chat client. For this project, we cannot use a UI and it must be written in Java. I haven't used Java in quite some time so I find myself stuck trying to find the "Java" way to do something.
What I am trying to do is allow incoming data to be processed and printed to the console but at the same time allowing for input. I know it is not a simple task (or sometimes even possible) to have simultaneous non-blocking input/output, but luckily this isn't exactly what I am looking for either. The best way to describe what I want is the ability to let output to be processed and displayed and printed until user input begins.
I know this can be done in C/C++ with a switch statement, but as far as I have found there is no equivalent in Java. I have come across the nio package, and have begun reading through it, but to no avail yet so far.
What are some suggestions on how best to perform this task using Java's toolset? Also, apologies if this isn't clear, I am having a difficult time putting my desires into words.