protected void createCalendarDoc() {
		try {
			/**
			 * Clear the document. Required for date roll overs.
			 */
			document.remove(0, document.getLength());
			
			/**
			 * Insert the calendar header of month and year.
			 */
			document.insertString(0, MONTHS[displayMonth] + HEADER_TAB_SPACE[displayMonth] + HEADER_WHITE_SPACE + displayYear + "\n", title);
			
			SimpleAttributeSet attrs = weekday;
			
			/**
			 * Get the starting day of week for the month.
			 */
			int startDay = dayOfWeek(displayMonth, 1, displayYear);
			
			/**
			 * Insert any blank days into the first line of the calendar pane.
			 */
	        for(int i = 0; i < startDay; i++) {
	        	document.insertString(document.getLength(), "\t", attrs);
	        }
	        
	        /**
	         * Iterate through the days in the month. 
	         */
	        for(int i = 1; i <= daysInMonth; i++) {
	        	/**
	        	 * Set the text style attributes of the day numbers base on:
	        	 * weekday, Sunday, Saturday, and today.
	        	 */
	        	if(isSaturday(i)) {
	        		attrs = saturday;
	        	}
	        	else if(isSunday(i)) {
	        		attrs = sunday;
	        	}
	        	else {
	        		attrs = weekday;
	        	}	        	
	        	if(isToday(i)) {
	        		attrs = today;
	        	}
	        	
	        	/**
	        	 * Provide a single space of left padding for the single digit
	        	 * dates.
	        	 */
	        	if(i<10) {
	        		document.insertString(document.getLength(), " ", attrs);
	        	}
	        	
	        	/**
	        	 * Insert the appropriate date number.
	        	 */
	        	document.insertString(document.getLength(), String.format("%2d", i), attrs);
	        	
	        	/**
	        	 * Insert a line break at the end of week and end of month. Else,
	        	 * insert a tab between the numbers.
	        	 */
	            if(((i + startDay) % 7 == 0) || (i == daysInMonth)) {
		        	document.insertString(document.getLength(), "\n", attrs);
	            }
	            else {
	            	document.insertString(document.getLength(), "\t", attrs);
	            }
	        }
		}
		catch(Exception e) {
			/**
			 * Log any exceptions that are thrown during the document creation process.
			 */
			LOGGER.severe(e.getMessage());
		}
	}