public CalendarProject (int y,int n)//pass in start year and day of January 1st
	{
		 myYears = createYears(y,n);
		 
		 JPanel content = new JPanel (new GridBagLayout());
		 info = new JPanel (new GridBagLayout());
		 JButton addEventButton = new JButton();
		 JButton modifyButton = new JButton("Modify...");
		 JButton addButton = new JButton("Add Event");
		 JButton removeButton = new JButton("Remove");
		 modifyButton.addActionListener(new ButtonPress());
		 addEventButton.addActionListener(new ButtonPress());
		 removeButton.addActionListener(new ButtonPress());
		 GridBagConstraints c = new GridBagConstraints();//Calendar layout
		 GridBagConstraints d = new GridBagConstraints();//information layout
		 JMenuBar menuBar = new JMenuBar();
		 menuBar.add(new JMenu("File"));
		 
		 //File chooser
		 JFileChooser f = new JFileChooser();
		 f.setFileSelectionMode (JFileChooser.DIRECTORIES_ONLY);
		 f.setDialogTitle("Select existing home directory or location of new directory");
		 f.showDialog(this,"Ok");
		 
		 try{//ask for the directory
			 
		 homeFile = new File(f.getSelectedFile().toString()+"/Calendar");
	 
		 }
		 catch (Exception e)//presses cancel or closes 
		 {
			 System.exit(0);
		 }
		 homeFile.mkdir();//make the directory if it isn't already there

		File file = new File (homeFile+"/years.cal");

//		 if(file.exists())
//		 {
//			 try{
//			 FileInputStream saveFile = new FileInputStream(file);
//			 ObjectInputStream restore = new ObjectInputStream(saveFile);
//			 Object obj = restore.readObject();
//			 Year y2= (Year) restore.readObject();
//			 System.out.println(y2.getNumber());
////			 display = new CalendarDrawArea(years.get(0), (int)(0.735*WIDTH) ,(int)(0.91*HEIGHT));	
//			 restore.close();
//			  }
//			 catch(Exception e)
//			 {
//				e.printStackTrace();
//			 }
//		 }
//		 
//		 else
//		 {
//		 }
		 Year year1 = new Year (y,n);

		 display = new CalendarDrawArea(year1, (int)(0.735*WIDTH) ,(int)(0.91*HEIGHT));				 

		 display.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
		 display.getInputMap().put(KeyStroke.getKeyStroke("SPACE"),"pressed");//make the computer react when the space bar is pressed
		 display.getActionMap().put("pressed",new Action());//when the pressed key is called 
		//layout for the calendar draw area panel 
		c.fill=GridBagConstraints.BOTH;
		c.anchor=GridBagConstraints.CENTER;
		c.weightx =0.25;
		c.weighty=0.25;
		c.gridwidth=10;
		c.gridheight=20;
		c.gridx=0;
		c.gridy=0;
		content.add(display,c);
		
		//layout for information panel
		d.fill=GridBagConstraints.BOTH;
		d.anchor=GridBagConstraints.LINE_START;
		d.gridx = 0;
		d.gridy = 0;
		d.gridwidth = 10;
		d.gridheight = 1;
		d.insets = new Insets(0, 10, 0,0);
		info.add(dayLabel,d);
		d.gridy = 1;
//		d.anchor = GridBagConstraints.PAGE_END;
		info.add(dateLabel,d);
//		info.add(new JLabel("\n\n\n\n\n\n\n\nd\nd"));
		d.gridy = 2;
		d.gridx = 1;
		d.gridheight = 10;
		d.gridwidth = 10;
		d.weighty = 1.0;
		d.insets = new Insets(20, 10, 0,0);
		info.add(eventsPanel,d);
		d.insets = new Insets(0, 10, 0,0);
		d.gridy = 13;
		d.gridx = 1;
		d.gridwidth = 1;
//		info.add(modifyButton,d);
		d.gridx = 2;
//		info.add(addButton,d);
				
		contents = new JSplitPane (JSplitPane.HORIZONTAL_SPLIT,info,content);
		contents.setDividerLocation((int)(0.25*WIDTH));
		contents.setEnabled(false);
		dateLabel.setFont(BOLD_FONT);
		dayLabel.setFont(BOLD_FONT);
		
		
		//set the properties of the JFrame
		addComponentListener(this);
		this.setResizable(true);
		this.setContentPane (contents);
		this.setMinimumSize(new Dimension (1000, 700));
		this.setSize(WIDTH,HEIGHT);
		this.setLocationRelativeTo (null);
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		this.setTitle("Michelle's Calendar");
		this.setJMenuBar(menuBar);
		this.setIconImage(icon);//set icon for program
	    display.requestFocusInWindow();//so the mouse listener works
	    
//	    this.addWindowListener(new WindowAdapter()
//	    {
//	    	public void windowClosing(WindowEvent e)
//	    	{
//	    		try{
//	    			final ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(homeFile+"/years.cal"));
//	    			for (int i = 0;i<years.size();i++)
//	    				out.writeObject(years.get(i));
//	    		    out.close();    		    
//	    			}
//	    		catch(Exception e1)
//	    		{
//	    			System.out.println(e1.getMessage());
//	    		}
//	    		System.exit(0);//exit the program
//	    	}
//	    });

		this.setVisible(true);//set the window visible
		

	}