I have a bot program to test my server. I would like it to exit the loop if any key was press, but do not want it to stop and wait until a key was press. thus the loop would keep running until any key on the keyboard was press.
This is how I'm trying to do it now, but does not work
if (System.in.available()>0)
{
System.out.println("key pressed");
break; // exit loop
}