@Override
	public void actionPerformed(ActionEvent event) {
		if (event.getSource() == exitButton) {
			System.exit(0);
		}

		String theTime;

		// accept host name from the user...
		String host = hostInput.getText();
		final int DAYTIME_PORT = 1300;

		try {
			// crate a socket object to connect to the
			// specified host on the relevant port...
			socket = new Socket(host, DAYTIME_PORT);

			// create an input stream for the above socket
			// and add string-reading functionality...
			Scanner input = new Scanner(socket.getInputStream());
			// Accept the hosts response via the above system
			theTime = input.nextLine();

			// add the host's response to the text in the Jtextarea..
			display.append("The date/time at " + host + " is " + theTime + "\n");
			hostInput.setText("");

		} catch (UnknownHostException e) {
			display.append("No such host!\n");
			hostInput.setText("");
		} catch (IOException e) {
			display.append(e.toString() + "\n");
		} finally {
			if (socket != null) {
				try {
					// close link to host
					socket.close();
				} catch (IOException e) {
					System.out.println("Unable to disconnect!");
					System.exit(1);
				}
			}
		}

	}