@Override
		public void actionPerformed(ActionEvent arg0) {
			if(arg0.getActionCommand().equals("file")){

				JFileChooser chooser = new JFileChooser();
				int retval = chooser.showOpenDialog(null);
				
				if(retval == JFileChooser.APPROVE_OPTION){
					chooser.setVisible(false);
					fileDir = chooser.getSelectedFile().getAbsolutePath();
				}
				else{
					chooser.setVisible(false);
				}
			}
			else if (arg0.getActionCommand().equals("yes")){
				pruning = true;
			}else if (arg0.getActionCommand().equals("no")){
				pruning = false;
			}else if(arg0.getActionCommand().equals("ok")){
				mainWindow.setVisible(false);
				Node result = null;
				try {
					SampleSet instances = createInstancesX(fileDir);
					if(pruning){
						SampleSet[] newSets = randomSplitForPrunning(instances);
						Node root = Node.createDT(newSets[0]);
						System.out.println("Before Pruning:");
						root.prettyPrint(0);
						Pruner pruner = new Pruner(newSets[1], root);
						result = pruner.prune();
						System.out.println("After pruning:");
						result.prettyPrint(0);
					}else{
						
						result = Node.createDT(instances);
						result.prettyPrint(0);
					}
					result.createOutputFile(fileDir);
					System.exit(0);
					
				} catch (IOException e) {

					JOptionPane.showMessageDialog(mainWindow, e.getMessage()+"\nPlease choose another file!");
					mainWindow.setVisible(true);
					
				}
			}else if (arg0.getActionCommand().equals("cancel")){
				mainWindow.setVisible(false);
				System.exit(0);
			}
		
		}