interrupted = false; final SwingWorker worker = new SwingWorker() { public Object construct() { try
ircWorker = new Thread() { public void run() { try { while (!isInterrupted()) { String line = fromServer.readLine(); if (line != null)
    public void start() { //synchronized void start()        interrupted = false;        final SwingWorker worker = new SwingWorker() {                    public Object construct() {                        try                        {                            while (!interrupted)                            {                                String line = fromServer.readLine();                                if (line != null)                                {                                    parseFromServer(line);                                }                                else                                {                                    interrupted = true;                                    // a null line indicates that our server has                                    // closed the connection, right?                                    tabUpdate("Init Window",                                              "READ a null line, server closed the connection or network is fucked.");                                    closeAll();                                    try                                    {                                        wait(5000);                                    }                                    catch (InterruptedException e)                                    {                                        e.printStackTrace();  //To change body of catch statement use Options | File Templates.                                    }                                }                            }                        }                        catch (IOException e)                        {                            System.out.println(                                    "Read Exception from Server. Exception is something like:");                            System.out.println(e);                        }                        return null;                    }                    public void finished() {                        SwingUtilities.invokeLater(new Runnable(){                            public void run(){                                connectStartRegister();                            }                        });                    }                };        worker.start();    }