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
Post a Comment