public boolean submit(Submission submission) {
		boolean result = false;

		// Get ConfigManager object
		ConfigManager cm = new ConfigManager();

		try {
			// Try to connect to RMI through port 1099
			Registry registry = LocateRegistry.getRegistry(cm.getServerIp(),
					1099);
			Rmi rmi = (Rmi) registry.lookup("pcs");

			// Send submission
			if (rmi.sendSubmission(submission, this.username)) {
				// Received by server
				JOptionPane.showMessageDialog(null,
						"Submission sent. Validation will take place soon.");
				result = true;
			} else {
				// Not accepted (contest not running)
				JOptionPane.showMessageDialog(null,
						"Submissions closed. Contest isn't running.");
				result = false;
			}

		} catch (RemoteException | NotBoundException e) {
			// Problem with the server connection
			JOptionPane.showMessageDialog(null, "Could not connect to server.");
			result = false;
			e.printStackTrace();
		}

		return result;
	}