public void actionPerformed(ActionEvent e) {

        //Handle split button action.
        if (e.getSource() == splitButton) {
            int returnVal = fc.showOpenDialog(Main.this);
            if (returnVal == JFileChooser.APPROVE_OPTION) {
                File file = fc.getSelectedFile();
                log.append("Splitting: " + file.getName() + "." + newline);
                try {
					Client client = new Client();
					client.sendFile(file);
					if (client.isFileSplited()){
						 log.append("File successfully splited!"+ newline);
					}
					else {
						 log.append("File splitting failed."+ newline);
					}
				} catch (IOException e1) {
					e1.printStackTrace();
				}
            } else {
                log.append("Split command cancelled by user." + newline);
            }
            log.setCaretPosition(log.getDocument().getLength());

        //Handle combine button action.
        } else if (e.getSource() == combineButton) {
        	try {
				Client client = new Client();
				client.getFile();
				if(client.isFileCombined()){
					log.append("File combined." + newline);
	            }
				else {
					log.append("File combined failed."+ newline);
				}
			} catch (IOException e1) {
				e1.printStackTrace();
			}
            
            log.setCaretPosition(log.getDocument().getLength());
        }
    }