Doing 2 things at the same time in Java
<p>Well, I'm working on an online game in Java. I have a client and a server. And the speech system waits for a new message to be displayed like this:</p>

<pre><code>public void addSpeech(String msg) {
    String newMsg = parsel10n(msg);
    m_narrator.addSpeech(parsel10n(newMsg));
    while (!m_narrator.getCurrentLine().equalsIgnoreCase(newMsg))
      ;
    while (!m_narrator.getAdvancedLine().equalsIgnoreCase(newMsg))
      ;
 } 
</code></pre>

<p>The problem is.. the rest of the application stops because of the while loops. I don't see any other players move or see the chat while in this loop. Is there a way I could run this method without touching the rest of the application (client) with the loops? Should threads be involved? I hope you'd be able to answer me. </p>
