private void saveProject() {
		System.out.println("Saving project: " + projFile.getName());
		
		ProjectView pv = frame.getProjView();
		
		try {
			FileOutputStream out = new FileOutputStream(projFile);
			writeln("General", out);
			writeln("ProjViewWidth=" + frame.getProjView().getWidth(), out);
			writeln("ProjViewHeight=" + frame.getProjView().getHeight(), out);
			writeln("TableWidth=" + ProjectView.TABLE_WIDTH, out);
			writeln("TableHeight=" + ProjectView.TABLE_HEIGHT, out);
			writeln("TableSpeed=" + ProjectView.TABLE_SPEED, out);
			int red = ProjectView.PROJ_VIEW_BACK_COLOR.getRed();
			int green = ProjectView.PROJ_VIEW_BACK_COLOR.getGreen();
			int blue = ProjectView.PROJ_VIEW_BACK_COLOR.getBlue();
			writeln("ProjViewBackground=" + red + " " + green + " " + blue, out);
			writeln(out);
			
			//Saves all the teams to the file.
			writeln("Teams", out);
			//[Team Name]=[Red value] [Green value] [Blue value]
			for(int i = 0; i < pv.teams.size(); i++) {
				Team team = pv.teams.get(i);
				int r = team.getColor().getRed();
				int g = team.getColor().getGreen();
				int b = team.getColor().getBlue();
				writeln(team.getTeamName() + "=" + r + " " + g + " " + b, out);
			}
			writeln(out);
			
			//Saves all the counselors to the file.
			writeln("Counselors", out);
			//[Counselor name]=[Cabin name]:[Team Name]
			for(int i = 0; i < pv.counselors.size(); i++) {
				Counselor c = pv.counselors.get(i);
				String cabinName = "null";
				if(!c.getCabinName().trim().equals("")) {
					cabinName = c.getCabinName();
				}
				String team = "null";
				if(c.getTeam() != null) {
					team = c.getTeam().getTeamName();
				}
				writeln(c.getName() + "=" + cabinName + ":" + team, out);
			}
			writeln(out);
			
			//Saves all the counselor's partners to the file.
			writeln("Partners", out);
			//[Counselor name]=[Partner name]
			for(int i = 0; i < pv.counselors.size(); i++) {
				Counselor c = pv.counselors.get(i);
				String partner;
				if(c.getPartner() == null) partner = "null";
				else partner = c.getPartner().getName();
				
				writeln(c.getName() + "=" + partner, out);
			}
			writeln(out);
			
			//Saves all the tables to the file.
			writeln("Tables", out);
			//[Counselor name]=[Team name]:[X] [Y] [Width] [Height] [fixed] [id]
			for(int i = 0; i < pv.tables.size(); i++) {
				Table t = pv.tables.get(i);
				
				if(t.getCounselor() == null) {
					write("null=", out);
				} else {
					write(t.getCounselor().getName() + "=", out);
				}
				if(t.getTeam() == null) {
					write("null:", out);
				} else {
					write(t.getTeam().getTeamName() + ":", out);
				}
				writeln(t.getX() + " " + t.getY() + " " + t.getWidth() + " " + t.getHeight() + " " + t.isFixed() + " " + t, out);
			}
			writeln(out);
			
			//Saves all the tables' partners to the file.
			writeln("TablePartners", out);
			//[Table ID]=[Table Partner ID]
			for(int i = 0; i < pv.tables.size(); i++) {
				Table t = pv.tables.get(i);
				
				String id = t.getPartner() == null ? "null" : t.getPartner().toString();
				
				writeln(t + "=" + id, out);
			}
			
			out.close();
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch(IOException e) {
			e.printStackTrace();
		} catch(Exception e) {
			e.printStackTrace();
		}
	}