java - Method that runs in parallel of a KeyListener -


i have keylistener listens keyboard on window. if off mark, please feel free correct me, adequate method called @ event key pressed.

now, in infinite loop, have method listens on socket input:

while (true) {     inputstream.read();     ... } 

does mean if key ever pressed, keypressed() never called pick up? have start separate thread it?

if infinite loop in same thread, keylistener not called, , if called, nothing happen since execution in infinite loop until exit in moment.

if plan create infinite loop (first should make sure approach looking for) need separate thread, , design of exact behavior want


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -