Java JOptionPane.showInputDialog() getting called more than once when code only says once
<p>Okay, so I'm making a online fighting game and the dialog where you input the server IP keeps popping up again and again even though the code only asks for it once. It's not in any kind of loop though, so I dunno what's going on.</p>

<pre><code>    public void connectAndInit(){
        try{
         String ip = JOptionPane.showInputDialog("Input server IP."); 
        players = new Player[MAX_PLAYERS];
        players[0] = new Player(25,25,135);
        players[1] = new Player(750,550,315);

        ct = new ClientThread(ip, players);
        ct.start();
        ct.setPriority(Thread.MAX_PRIORITY);

        playerNum = ct.playerNum;

         init = false;
        }

        catch(Exception e){
      e.printStackTrace();
     }
    }

    @Override
    public void update()
    {
         if(init)
         connectAndInit();
    }
</code></pre>

<p>Here is the game with the problem: <a href="http://prime.programming-designs.com/java/metaship-client.jnlp" rel="nofollow">http://prime.programming-designs.com/java/metaship-client.jnlp</a></p>

<p>And here is the server you need to start before you run the game: <a href="http://prime.programming-designs.com/java/metaship-server.jnlp" rel="nofollow">http://prime.programming-designs.com/java/metaship-server.jnlp</a></p>
