public Editor() {
		setLayout(new BorderLayout());
		//create icons for tabs
		ImageIcon textIcon = createImageIcon("/icons/darktext.png");
		ImageIcon audioIcon = createImageIcon("/icons/darksound.png");
		ImageIcon videoIcon = createImageIcon("/icons/video.png");
		//define tabs
		editorTabs.add(Text.getInstance());
		editorTabs.setIconAt(0, textIcon);
		editorTabs.add(Edit.getInstance());
		editorTabs.setIconAt(1, audioIcon);
		editorTabs.add(ImageEdit.getInstance());
		editorTabs.setIconAt(2, videoIcon);
		//add change listener to check audio signal when Edit tab selected
		editorTabs.addChangeListener(new ChangeListener() {

			@Override
			public void stateChanged(ChangeEvent arg0) {
				if (Main.getInstance().original != null) {
					enableButtons();
					if (editorTabs.getSelectedComponent().equals(Edit.getInstance())
						&& Main.getInstance().original != null) {
						Edit.getInstance().findNumberOfAudioTrack();
					}
				}
				
			}
			
		});
		add(editorTabs, BorderLayout.CENTER);
		
		JPanel topPanel = new JPanel();
		add(topPanel, BorderLayout.NORTH);
		topPanel.setLayout(new BorderLayout());
		
		topPanel.add(choosePanel, BorderLayout.WEST);
		choosePanel.setLayout(new BoxLayout(choosePanel, BoxLayout.X_AXIS));
		
		JButton btnChooseFile = new JButton("Choose file");
		choosePanel.add(btnChooseFile);
		btnChooseFile.setIcon(createImageIcon("/icons/folder.png"));
		choosePanel.add(selectLabel);
		
		topPanel.add(savePanel, BorderLayout.EAST);
		savePanel.add(saveButton);
		saveButton.setIcon(createImageIcon("/icons/save.png"));
		
		saveButton.setEnabled(false);
		//add action listener to implement save changes
		saveButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				//create output file selector panel
				JPanel outSelectPanel = new JPanel();
				outSelectPanel.setPreferredSize(new Dimension(420,180));
				outSelectPanel.setLayout(new BoxLayout(outSelectPanel, BoxLayout.X_AXIS));
				outSelectPanel.add(new JLabel("Select output file: "));
				final JTextField outText = new JTextField();
				outText.setSize(250, 20);
				outText.setText(System.getProperty("user.home"));
				outText.setMaximumSize(new Dimension(150,25));
				outSelectPanel.add(outText);
				outSelectPanel.add(new JLabel(" "));
				JButton browse = new JButton("Browse");
				browse.addActionListener(new ActionListener() {

					@Override
					public void actionPerformed(ActionEvent e) {
						//open file chooser in new window
						JFileChooser selector = new JFileChooser();
						selector.showOpenDialog(Editor.this);
						try {
							outText.setText(selector.getSelectedFile().getAbsolutePath());
						} catch (NullPointerException e1) {
							
						}
					}
					
				});
				outSelectPanel.add(browse);
				
				String[] options = {"Save","Cancel"}; //options for option pane
				//create an option pane to open up output file chooser window
				int n = JOptionPane.showOptionDialog(null, outSelectPanel, 
						"Save Video", JOptionPane.YES_NO_OPTION, 
						JOptionPane.NO_OPTION, null, options, options[0]);
				if ( n == 0) {
						//check if file exists
					File dummy = new File(outText.getText());
					if (dummy.exists()) {
						JOptionPane.showMessageDialog(null, 
								"Error: You cannot override an existing file", 
								"Override error", JOptionPane.ERROR_MESSAGE);
						return;
					}
					boolean worked = Editor.getInstance().outputFile.renameTo(new File(outText.getText()));
					if (!worked) {
						JOptionPane.showMessageDialog(null, 
								"Error: There was an error creating the new saved file. "
								+ "Save operation was not successful.", 
								"Save error", JOptionPane.ERROR_MESSAGE);
					} else {
						JOptionPane.showMessageDialog(null, 
								"Save operation successful!", "Success!", 
								JOptionPane.PLAIN_MESSAGE);
						//set new input file as the saved file
						Main.getInstance().original = new File(outText.getText());
						setFilenameLabel();
						//enable play on new file
						Playback.getInstance().enablePlay();
						ImageEdit.getInstance().updateCropView(); //adjust crop view for new file
					}
				}
			}
		});
		btnChooseFile.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				//open file chooser in new window
				JFileChooser fileSelector = new JFileChooser();
				fileSelector.showOpenDialog(Editor.this);
				try {

					if (Main.getInstance().checkFile(fileSelector.getSelectedFile().toString())){
						//get File object of selected file
						Main.getInstance().original = fileSelector.getSelectedFile().getAbsoluteFile();
						//get absolute path (includes name of file) in fileDir
						fileDir = fileSelector.getSelectedFile().getAbsolutePath();
						//set label GUI component
						setFilenameLabel();
						//get path of file (excluding file name)
						filepath = fileDir.substring(0, fileDir.lastIndexOf(File.separator));
						//set the outputFile (unsaved file) as a dot file of selectedFile
						outputFile = new File(filepath + "/." + Main.getInstance().original.getName());
						Playback.getInstance().enablePlay();
						//invoke audio signal check in Edit for new chosen file						
						Edit.getInstance().findNumberOfAudioTrack();
						enableButtons(); //enable useful buttons now that file is selected
						//update metadata for file
						MediaFile.getInstance().update();
						ImageEdit.getInstance().updateCropView();
						ImageEdit.getInstance().updateCropView();
					} else {
						JOptionPane.showMessageDialog(null, "Please select a video or audio file", "Error!", JOptionPane.ERROR_MESSAGE);
					}
				} catch (NullPointerException e) {
					return; //return since no file was selected
				}
						
			}
		});
		
		
	}