@Override
	public void update(Observable o, Object arg) {
		// TODO Auto-generated method stub
		Schedule sched = model.getBestSchedule();

		jTextPane.setText("");
		printTxtPane.setText("");
		removeBt.clear();

		for (int i = 0; i < removeBt.size(); i++)
		{
			jTextPane.remove(removeBt.get(i));
			System.out.println("Button Removed");
		}
		jTextPane.validate();



		Iterator<Course> it = sched.getCourses().iterator();

		if (it.hasNext() == false)
		{
			try {
				jTextPane.getStyledDocument().insertString(jTextPane.getStyledDocument().getLength(), "Sorry, no schedule can be created.", null);
				printTxtPane.getStyledDocument().insertString(printTxtPane.getStyledDocument().getLength(), "Sorry, no schedule can be created.", null);
			} catch (BadLocationException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}

		}
		else 
		{
			//courseResults = control.orderCoursesByDay(sched);
			courseResults = (ArrayList<Course>) schedViewChoice.orderSched(sched);
			it = courseResults.iterator();
			
			
			int i = 0;
			while(it.hasNext())
			{
				Course course = it.next();
				if (course != null)
				{
					
					//control.getResults(course, jTextPane.getStyledDocument());
					//control.getResults(course, printTxtPane.getStyledDocument());
					schedViewChoice.getResults(course, jTextPane.getStyledDocument());
					schedViewChoice.getResults(course, printTxtPane.getStyledDocument());
					try {
						jTextPane.getStyledDocument().insertString(jTextPane.getStyledDocument().getLength(), "   ", null);
						printTxtPane.getStyledDocument().insertString(printTxtPane.getStyledDocument().getLength(), "   ", null);

					} catch (BadLocationException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}

					//Position p = jTextPane.getStyledDocument().getEndPosition();
					jTextPane.setCaretPosition(jTextPane.getStyledDocument().getLength());
					if (!control.checkIfLast(course, model))
					{
						System.out.println("ISJDFOIJSDOFH");
						JButton bt = new JButton("Remove");
						bt.addActionListener(this);
						bt.setActionCommand(i + "");
						removeBt.add(bt);
						jTextPane.insertComponent(bt);
					}

					try {
						jTextPane.getStyledDocument().insertString(jTextPane.getStyledDocument().getLength(), "\n\n", null);
						printTxtPane.getStyledDocument().insertString(printTxtPane.getStyledDocument().getLength(), "\n\n", null);

					} catch (BadLocationException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
				}
				else
				{
					try {
						// Create a bold style
						StyledDocument doc = jTextPane.getStyledDocument();
						Style def = StyleContext.getDefaultStyleContext().getStyle( StyleContext.DEFAULT_STYLE );
						Style regular = doc.addStyle( "regular", def );
						
						Style bold = doc.addStyle( "bold", regular );
						StyleConstants.setBold( bold, true );
						
						jTextPane.getStyledDocument().insertString(jTextPane.getStyledDocument().getLength(), Day.values()[i].toString()+"\n\n", bold);
						printTxtPane.getStyledDocument().insertString(printTxtPane.getStyledDocument().getLength(), Day.values()[i].toString()+"\n\n", bold);

					} catch (BadLocationException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
					i++;
				}
				
			}
		}


	}