private void connectToServer() {
		if(iptf.getText().equals(""))
		{
			JOptionPane.showMessageDialog(SwitchServerWindow.this, "The IP can't be blank!", "Error", JOptionPane.ERROR_MESSAGE);
		}else
		{
			if(connect == null || !connect.isAlive()) {
				connect = new Thread( new Runnable() {
					
					@Override
					public void run() {
						boolean correct = false;
						connectb.setVisible(false);
						connectb.repaint();
						sp.setVisible(true);
						try {
							iptf.setEnabled(false);
							AdminClient.client = new Client(iptf.getText(), 1234);
							correct = true;
						} catch (IOException e1) {
							iptf.setEnabled(true);
							iptf.setText("");
							sp.setVisible(false);
							AdminClient.client = null;
							connectb.setVisible(true);
							JOptionPane.showMessageDialog(SwitchServerWindow.this, "Couldn't connect with the server.", "Error", JOptionPane.ERROR_MESSAGE);
						}
						if(correct) {
							SwitchServerWindow.this.dispose();
						}
					}
				});
				connect.start();
			}
		}
	}