@Override
	public void actionPerformed(ActionEvent e) {
		// Handle open button action.
		if (e.getSource() == view.getOpenButton()) {
			int returnVal = fc.showOpenDialog(view);

			if (returnVal == JFileChooser.APPROVE_OPTION) {
				file = fc.getSelectedFile();
				// This is where a real application would open the file.
				view.getTextArea().setText(file.getName());
			} else {
				view.getTextArea().setText("Open command cancelled by user.");
			}
		}
		if (e.getSource() == view.getExitButton()) {
			if (this.view.getExitButton() == e.getSource()) {
				control.getFrame().dispose();
			}
		}
		if (e.getSource() == view.getTransferButton()) {
			if(file != null){
				User user = (User) view.getUserList().getSelectedItem();
				this.client.sendFile(file.getAbsolutePath(), user.getIP());
				this.control.getGui().addTransferMessage(this.client.getOwnUser().getIP(), user.getIP(), file.getName(), Timestamp.getCurrentTimeAsLong(), false);
				control.getFrame().dispose();
			} else {
				new Popup("No file selected");
			}
		}
	}