protected JPanel createDaysGUI() 
        {
            JPanel dayPanel = new JPanel(true);
            dayPanel.setLayout(new GridLayout(0, dayNames.length));

            Calendar calendar = Calendar.getInstance();
            calendar.set(Calendar.MONTH, month);
            calendar.set(Calendar.YEAR, year);
            calendar.set(Calendar.DAY_OF_MONTH, 1);
            
            // Create an iterator to go through the current month's days.
            Calendar iterator = (Calendar) calendar.clone();
            iterator.add(Calendar.DAY_OF_MONTH,
                    -(iterator.get(Calendar.DAY_OF_WEEK) - 1));

            Calendar maximum = (Calendar) calendar.clone();
            maximum.add(Calendar.MONTH, +1);

            // Create a panel for each day of the week.
            for (String dayName : dayNames)
            {
                JPanel dPanel = new JPanel(true);
                dPanel.setBorder(BorderFactory.createLineBorder(Color.BLACK));
                JLabel dLabel = new JLabel(dayName);
                dPanel.add(dLabel);
                dayPanel.add(dPanel);
            }

            int count = 0;
            int limit = dayNames.length * 6;

            while (iterator.getTimeInMillis() < maximum.getTimeInMillis()) {
                int lMonth = iterator.get(Calendar.MONTH);
                int lYear = iterator.get(Calendar.YEAR);

                JPanel dPanel = new JPanel(true);
                dPanel.setBorder(BorderFactory.createLineBorder(Color.BLACK));
                JLabel dayLabel = new JLabel();

                if ((lMonth == month) && (lYear == year)) {
                    int lDay = iterator.get(Calendar.DAY_OF_MONTH);
                    dayLabel.setText(Integer.toString(lDay));
                    dPanel.setBackground(Color.WHITE);
                    
                    if (Integer.parseInt(dayLabel.getText().trim()) == day)
                    {
                        dPanel.setBackground(Color.ORANGE);
                        currentPanel = dPanel;
                    }
                } else {
                    dayLabel.setText(" ");
                    dPanel.setBackground(Color.WHITE);
                }
                dPanel.addMouseListener(new MouseAdapter()
                {
                    @Override
                    public void mousePressed(MouseEvent e)
                    {
                        // Find the source panel and the label on it. Change the color and save the date.
                        JPanel previousPanel = currentPanel;
                        currentPanel = (JPanel)e.getSource();
                        JLabel currentLabel = (JLabel)currentPanel.getComponent(0);
                        
                        if (currentLabel.getText().trim().equals(""))
                        {
                            currentPanel = previousPanel;
                            return;
                        }
                        
                        day = Integer.parseInt(currentLabel.getText().trim());
                        parent.updateDateLabel(LocalDate.of(year, month + 1, day).format(DateTimeFormatter.ofPattern("MM/dd/yyyy")));
                        
                        if (previousPanel != null)
                        {
                            previousPanel.setBackground(Color.WHITE);
                        }
                        currentPanel.setBackground(Color.ORANGE);
                    }
                });
                dPanel.add(dayLabel);
                dayPanel.add(dPanel);
                iterator.add(Calendar.DAY_OF_YEAR, +1);
                count++;
            }

            for (int i = count; i < limit; i++) {
                JPanel dPanel = new JPanel(true);
                dPanel.setBorder(BorderFactory.createLineBorder(Color.BLACK));
                JLabel dayLabel = new JLabel();
                dayLabel.setText(" ");
                dPanel.setBackground(Color.WHITE);
                dPanel.add(dayLabel);
                dayPanel.add(dPanel);
            }

            return dayPanel;
        }