public void init() {
		calls = new HashMap<String, CallWindow>();
		JFrame f = new JFrame("Chat Client Window");
		f.setLayout(null);
		f.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
		f.addWindowListener(new WindowListener() {
			public void windowActivated(WindowEvent arg0) {
				// Do nothing
			}
			public void windowClosed(WindowEvent arg0) {
				// Do nothing
			}
			public void windowClosing(WindowEvent arg0) {
				disconnect();
				System.exit(0);
			}
			public void windowDeactivated(WindowEvent arg0) {
				// Do nothing
			}
			public void windowDeiconified(WindowEvent arg0) {
				// Do nothing
			}
			public void windowIconified(WindowEvent arg0) {
				// Do nothing
			}
			public void windowOpened(WindowEvent arg0) {
				// Do nothing
			}
		});

		chat_box = new JTextArea();
		chat_box.setEditable(false);
		chat_box.setLineWrap(true);
		chat_box.setWrapStyleWord(true);

		chat_scroll = new JScrollPane(chat_box);
		chat_scroll.setBorder(new LineBorder(new Color(50, 50, 50), 5));
		chat_scroll.setSize(480, 540);
		f.add(chat_scroll);

		msg_box = new JTextArea();
		msg_box.setLineWrap(true);
		msg_box.setWrapStyleWord(true);
		JScrollPane msg_scroll = new JScrollPane(msg_box);
		msg_scroll.setBorder(new LineBorder(new Color(50, 50, 50), 5));
		msg_scroll.setBounds(0, 540, 380, 75);
		f.add(msg_scroll);

		send_button = new JButton("Send");
		send_button.setBounds(380, 540, 100, 50);
		send_button.setBorder(new LineBorder(new Color(50, 50, 50), 5));
		send_button.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				send();
			}
		});
		send_button.setEnabled(false);
		f.add(send_button);

		JCheckBox cb = new JCheckBox("↵ is send");
		cb.setBackground(new Color(50, 50, 50));
		cb.setForeground(new Color(255, 255, 255));
		cb.setBounds(380, 590, 100, 25);
		cb.addItemListener(new ItemListener() {
			public void itemStateChanged(ItemEvent e) {
				setEnterIsSend(e.getStateChange() == ItemEvent.SELECTED);
			}
		});
		f.add(cb);

		MenuBar mb = new MenuBar();
		Menu m = new Menu();
		m.setLabel("Options");

		mi_conn = new MenuItem("Connect to...");
		mi_conn.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				String[] socket = JOptionPane
						.showInputDialog(null,
								"Connect to socket: (formatted as <IP Address>:<port>)")
						.split(":");
				while (!isValidSocket(socket)) {
					socket = JOptionPane
							.showInputDialog(
									null,
									"You have entered an invalid socket, please try again.\n"
											+ "Connect to socket: (formatted as <IP Address>:<port>)")
							.split(":");
				}
				connect(socket);
			}
		});
		m.add(mi_conn);

		mi_disc = new MenuItem("Disconnect");
		mi_disc.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				disconnect();
			}
		});
		mi_disc.setEnabled(false);
		m.add(mi_disc);
		
		mi_voip = new MenuItem("VoIP call");
		mi_voip.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				if (connected) {
					String to = JOptionPane.showInputDialog("Call whom?");
					if (to.equals(name)) {
						update("[You can't call yourself!]");
					} else if (!to.equals(null)) {
						update("[Calling " + to + "...]");
						createCallWindow(to, CallWindow.OUTGOING);
					}
				} else {
					JOptionPane.showMessageDialog(null, "You cannot do this while not connected.");
				}
			}
		});
		mi_voip.setEnabled(false);
		m.add(mi_voip);
		
		mi_gn = new MenuItem("Get names");
		mi_gn.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				getNames();
			}
		});
		mi_gn.setEnabled(false);
		m.add(mi_gn);
		
		mi_chn = new MenuItem("Change name");
		mi_chn.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				if (!connected) {
					requestName();
				} else {
					JOptionPane.showMessageDialog(null,
							"You cannot change your name while connected.");
				}
			}
		});
		m.add(mi_chn);

		mi_help = new MenuItem("Help");
		mi_help.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				JOptionPane.showMessageDialog(null, help);
			}
		});
		m.add(mi_help);
		
		mi_exit = new MenuItem("Exit");
		mi_exit.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				disconnect();
				System.exit(0);
			}
		});
		m.add(mi_exit);
		mb.add(m);
		f.setMenuBar(mb);

		f.setSize(480, 640);
		f.setResizable(false);
		f.setVisible(true);

		chat_box.setText("[New chat window]\n");
	}