@SuppressWarnings("unchecked")
	TheCalendar(JFrame parent){
		// Sets OS specific look to the calendar
		try {
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		}
		catch (ClassNotFoundException e) {

		}
		catch (InstantiationException e) {

		}
		catch (IllegalAccessException e) {

		}
		catch (UnsupportedLookAndFeelException e) {

		}
		// Sets basic attributes of calendar features
		theParent = parent;
		mainFrame = new JFrame("Month View");
		month = new JLabel("January");
		month.setFont(new Font("Serif", Font.PLAIN, 18));
		year = new JLabel("Change Year:");
		yearBox = new JComboBox();
		backToMain = new JButton("Return to Menu");
		prev = new JButton("<-");
		next = new JButton("->");
		calendarTable = new DefaultTableModel()
		{
			public boolean isCellEditable(int rowIndex, int mColIndex)
			{
				return false;
			}
		};
		// Continues to set attributes and set up calendar
		Calendar = new JTable(calendarTable);
		calendarScroll = new JScrollPane(Calendar);
		calendarPanel = new JPanel(null);
		mainFrame.setSize(900,750);
		thePane = mainFrame.getContentPane();
		thePane.setLayout(null);
		mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		calendarPanel.setBorder(BorderFactory.createTitledBorder("Calendar"));
		thePane.add(calendarPanel);
		calendarPanel.add(month);
		calendarPanel.add(year);
		calendarPanel.add(yearBox);
		calendarPanel.add(prev);
		calendarPanel.add(next);
		calendarPanel.add(calendarScroll);
		calendarPanel.add(backToMain);
		// Sets boundaries of Calendar objects
		calendarPanel.setBounds(0, 0, 873, 700);
		month.setBounds(320-month.getPreferredSize().width/2, 50, 200, 50);
		year.setBounds(20, 610, 160, 40);
		yearBox.setBounds(660, 610, 160, 40);
		prev.setBounds(20, 50, 100, 50);
		next.setBounds(721, 50, 100, 50);
		calendarScroll.setBounds(20, 100, 800, 500);
		backToMain.setBounds(340, 610, 160, 40);
		// Creates Gregorian Calendar for making calendar accurate
		GregorianCalendar gregCal = new GregorianCalendar();
		theDay = gregCal.get(GregorianCalendar.DAY_OF_MONTH);
		theMonth = gregCal.get(GregorianCalendar.MONTH);
		theYear = gregCal.get(GregorianCalendar.YEAR);
		otherMonth = theMonth;
		otherYear = theYear;
		// Populates the days of the week on the calendar
		String[] days = {"Sun","Mon","Tue","Wed","Thu","Fri","Sat"};
		for (int i = 0; i < 7; i++){
			calendarTable.addColumn(days[i]);
		}
		// Basic settings
		Calendar.getParent().setBackground(Calendar.getBackground());
		Calendar.getTableHeader().setResizingAllowed(false);
		Calendar.getTableHeader().setReorderingAllowed(false);
		Calendar.setColumnSelectionAllowed(true);
		Calendar.setRowSelectionAllowed(true);
		Calendar.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
		Calendar.setRowHeight(76);
		calendarTable.setColumnCount(7);
		calendarTable.setRowCount(6);
		// Allows you to go forward or backward 50 years because why not
		for (int i = theYear-50; i < theYear+50; i++){
			yearBox.addItem(String.valueOf(i));
		}
		// Adds all listeners and sets up calendar to start in current month
		prev.addActionListener(new prevMonth());
		next.addActionListener(new nextMonth());
		yearBox.addActionListener(new changeYear());
		backToMain.addActionListener(new backToMenu());
		thisFrame = new MainInterface();
		thisFrame.setVisible(false);
		updateCalendar(theMonth, theYear);
		mainFrame.setResizable(false);
		mainFrame.setVisible(true);
		final StoreData theData = new StoreData();
		// Adds listener to each cell of the calendar
		Calendar.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent clicked) {
				SendToDB newRun = new SendToDB();
				int row = Calendar.rowAtPoint(clicked.getPoint());
				int col = Calendar.columnAtPoint(clicked.getPoint());
				if (row >= 0 && col >= 0) {
					String selectedData = null;
					selectedData = (String) Calendar.getValueAt(row, col);
					selectedData = selectedData.substring(6, 8);
					theMonth++;
					theData.setDate(""+theMonth+"-"+selectedData+"-"+theYear);
					theMonth--;
					newRun.runStore(theData, 5);
				}
				if(theData.getSingleDay().size() == 0){
					EmptyDay newEmpty = new EmptyDay(theData,theParent,theData.getSingleDay().size());
				}else{
					DayView newDay = new DayView(theData,theParent,theData.getSingleDay().size());
				}
			}
		});
	}