public AppWindow() {

		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 1200, 800);
		
		fc = new JFileChooser();		//Initialize file chooser for loading files
		fc.addChoosableFileFilter(new FileNameExtensionFilter("Profiles", "pro")); //Sets filter on file chooser
		fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);			//So only .pro files will be shown
		fc.setCurrentDirectory(saveDir); //Sets the directory of the filechooser to the save folder checked before
		
		menuBar = new JMenuBar();
		setJMenuBar(menuBar);
		
		mnFile = new JMenu("File");
		menuBar.add(mnFile);
		
		mntmNewProfile = new JMenuItem("New Profile");
		mntmNewProfile.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) //Asks user if destroying current profile is okay
			{	
				if(JOptionPane.showConfirmDialog(null, "Are you sure? Any Unsaved Changes will"
						+ " be lost", "Confirm new profile", 2) == 0)
						{
						
						setProfile(new Profile()); //Creates a new profile obeject
						String newName = JOptionPane.showInputDialog("Enter a name for profile: ");
						profile.setName(newName);
						
						if(profile.getName().length() == 0) // Ensures that the submitted name for the profile
							while(profile.getName().length() == 0)//Is not empty
							{
								profile.setName(JOptionPane.showInputDialog("Name must be longer"
									+ "than 0 Enter a name for profile: "));
							}	
						
						inputPane.setText("New Profile: " + profile.getName()); //Sets title of the program to
						setTitle(profile.getName());						//Match the current profile's name
						}
			}
		});
		mnFile.add(mntmNewProfile);
		
		mntmSaveProfile = new JMenuItem("Save Profile");
		mntmSaveProfile.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) 
			{
				try {
					if(profile.getName().equals("New Profile")) //Ensures that default profile name is not used
					{
						profile.setName(JOptionPane.showInputDialog("You need to" +
								"give the profile a name: "));
						while(profile.getName().length() == 0)
						{
							profile.setName(JOptionPane.showInputDialog("You need to" +
									"give the profile a name: "));
						}	
					}
					FileWriter writer = new FileWriter(System.getProperty("user.dir")+"\\Saves\\"+
				    profile.getName()+EXTENSION); //Creates a file writer within the save file folder
					writer.write(profile.toString());//Saves profile as a save file
					writer.close();
				} catch (IOException e) {
					e.printStackTrace(errorLogPrint);
					ERROR_LOG += errorLogWriter.toString() + "\n\n";
				}
			}
		});
		
		mntmRenameProfile = new JMenuItem("Rename Profile");
		mntmRenameProfile.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) 
			{
				profile.setName(JOptionPane.showInputDialog("Enter a" +//Allows user to rename the profile
						"new name: "));
				setTitle(profile.getName());
				while(profile.getName().length() == 0) //Ensures that the new profile name is not empty
				{
					profile.setName(JOptionPane.showInputDialog("You need to" +
							"give the profile a name: "));
				}
			}
		});
		mnFile.add(mntmRenameProfile);
		mnFile.add(mntmSaveProfile);
		
		mntmLoadProfile = new JMenuItem("Load Profile");
		mntmLoadProfile.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) 
			{
				int returnVal = fc.showOpenDialog(null); //Gets a user selected file
				
				if (returnVal == JFileChooser.APPROVE_OPTION) //Checks if the file-type is correct
				{
		            File file = fc.getSelectedFile();  //Creates a file from the selected save
		        try
		        {
		        saveReader = new Scanner(file).useDelimiter("//A"); //Read until end of file
				setProfile(new Profile(saveReader.next())); // Passes the new profile to this window and -
				inputPane.setText("Saved File read sucessfully!");//all other windows in program
				setTitle(profile.getName());
				saveReader.close(); //Closes the scanner
		        }catch(Exception ex)
		        {
		        	inputPane.setText("Error in reading text file!\n");	
		        	ex.printStackTrace(errorLogPrint);
					ERROR_LOG += errorLogWriter.toString() + "\n\n";
		        }
				}
			}
		});
		mnFile.add(mntmLoadProfile);
		
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(new BorderLayout(0, 0));
		setContentPane(contentPane);
		
		tabbedPane = new JTabbedPane(JTabbedPane.TOP);
		contentPane.add(tabbedPane, BorderLayout.CENTER);
		profile = new Profile();
		profile.setName("New Profile");
		
		overviewContainer = new OverviewContainer(profile);
		inputPane = new CRInputPane(profile, this);
		tabbedPane.addTab("CR Input Pane", null, inputPane, null);
		tabbedPane.addTab("Day Overview", null, overviewContainer, null);	
		
		statsPane = new StatsPane(profile);
		tabbedPane.addTab("Stats", null, statsPane, null);
	}