@Override
	public void actionPerformed(ActionEvent arg0) {
		if(arg0.getSource()==selectFilesButton){
			int returnVal;
			returnVal = fc.showDialog(this, "Attach");
			System.out.println("Browse returned "+returnVal+" "+JFileChooser.APPROVE_OPTION);
			if (returnVal == JFileChooser.APPROVE_OPTION) {
				// System.out.println("Performing copy options");
	            File[] ads = {fc.getSelectedFile()};
	            System.out.println("total Selected files "+ads.length);
	            //This is where a real application would open the file.
	            for(int i=0;i<ads.length;i++){
	            	File newFile = new File("Resources/ads/"+ads[i].getName());
	            	try {
	            		System.out.println("Copying files for ads "+ads[i].getName());
						FileCopy.copyFile(ads[i],newFile);
					} catch (IOException e) {						
						e.printStackTrace();
					}	            	
	            	adNames.add(ads[i].getName());
	            }
	            existingAds.updateUI();
	        } else {
	            // log.append("Open command cancelled by user." + newline);
	        }
		}else if (arg0.getSource()==removeAd){
			int index = existingAds.getSelectedIndex();
			String fileName = adNames.remove(index);
			File f = new File("Resources/ads/"+fileName);
			if(f.exists())
				f.delete();
			existingAds.updateUI();
		}else if (arg0.getSource()==OK){
			String defaultLanguage = (String) languageList.getSelectedItem();
			System.out.println("Changing language: "+defaultLanguage);
			ConfigurationReader.setServerInit("language", defaultLanguage);
		}
		
	}