private void connect() { try { chatSocket = new Socket(host, port); fromServer = new BufferedReader(new InputStreamReader( chatSocket.getInputStream())); toServer = new PrintWriter(new OutputStreamWriter( chatSocket.getOutputStream())); Component aComponent = tabbedPane.getComponentAt(0); ((InitPanel) aComponent).setTitleArea(nickname + " connected to: " + host + ":" + port);  } catch (IOException e) { System.err.println("Connection refused to: " + host + ":" + port); }
private void connect() throws IOException{ chatSocket = new Socket(host, port); fromServer = new BufferedReader(new InputStreamReader( chatSocket.getInputStream())); toServer = new PrintWriter(new OutputStreamWriter( chatSocket.getOutputStream())); Component aComponent = tabbedPane.getComponentAt(0); ( (InitPanel) aComponent).setTitleArea(nickname + " connected to: " + host + ":" + port);
    private void connect() {        try        {            chatSocket = new Socket(host, port);            fromServer = new BufferedReader(new InputStreamReader(                    chatSocket.getInputStream()));            toServer = new PrintWriter(new OutputStreamWriter(                    chatSocket.getOutputStream()));            Component aComponent = tabbedPane.getComponentAt(0);            ((InitPanel) aComponent).setTitleArea(nickname + " connected to: " +                                                  host + ":" + port);            //debugOut = new PrintWriter(new FileWriter(new File("Debug.txt")));        }        catch (IOException e)        {            System.err.println("Connection refused to: " + host + ":" + port);        }    }