Can anyone tell me why this program hangs, it doesn't crash and it also doesn't throw an exception or anything, it just hangs. If I define the hostname and port inside the Connect class instead of in the constructor like I do now it doesn't hang. Is this a VM issue? I am testing this by using netcat as a server: nc -L -p 80 -vv .

Code:
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
import java.net.*;
import java.io.*;

public class Crat extends JFrame {
	
	JButton connect = new JButton("Connect");
	JButton send = new JButton("Send some text");
	Connect conn = new Connect("192.198.1.3", 80);
	boolean connected = false;
	
	public Crat() {
		super("Crat client");
		
		connect.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent evt) {
				if (connected == false) {
				conn.establishConnection();
				connected = true;
			         }
		         }
	         });
		send.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent evt) {
				if (connected == true)
				conn.writer.println("Hello world!");
		         }
		});
		 
		JPanel pane = new JPanel();
		pane.add(connect);
		pane.add(send);
		
		setContentPane(pane);	
    }
    
    public static void main(String[] args) {
    	JFrame frame = new Crat();
    	
    	WindowListener l = new WindowAdapter() {
   
    		public void windowClosing(WindowEvent e) {
    			System.exit(0);
    			
    		}
        };
        frame.addWindowListener(l);
        
        frame.pack();
        frame.setVisible(true);
    }

}

class Connect {
	
	Socket socket = null;
         InputStreamReader isr = null;
	BufferedReader reader = null;
	PrintWriter writer = null;
	String address;
	int PORTNUM;
	
	public Connect(String host, int port) {
		address = host;
		PORTNUM = port;
    }
	
	void establishConnection() {
		
		try {
			socket = new Socket(address, PORTNUM);
			isr = new InputStreamReader(socket.getInputStream());
			reader = new BufferedReader(isr);
			writer = new PrintWriter(socket.getOutputStream(), true);
	    } catch (IOException e) {
	    	System.err.println("Exception: " + e.getMessage());
	    	System.exit(1);
	    }
    }
}
EDIT: I forgot to mention that it hangs upon clicking the Connect button, also, sorry for the lack of comments, well it's not that this piece of code really needs it but anyway.