private void connect() {
		config = new ConnectConfig();
		config.name = tfName.getText().trim();
		if (config.name.isEmpty()) {
			JOptionPane.showMessageDialog(this, "Empty name", "Error", JOptionPane.ERROR_MESSAGE);
			return;
		}
		config.ip = tfIP.getText();
		try {
			
		} catch(NumberFormatException ex) {
			
		}
		
		//PORT
		boolean portFailed = false;
		int port = -1;
		try {
			port = Integer.parseInt(tfPort.getText());
			if (port < 0 || port > 49151) {
				portFailed = true;
			}
		} catch (NumberFormatException ex) {
			portFailed = true;
		}
		if (portFailed) {
			JOptionPane.showMessageDialog(this, "Illegal port number", "Error", JOptionPane.ERROR_MESSAGE);
			return;
		}
		config.port = port;
		dispose();
	}