public void populateMonth(int startDay, int end) {
        //startAdding is used for the day of the month, it will only start to increment when we find the first day of the month
        resetGrid();
        int startAdding = 1;
        //has the month started yet?
        boolean monthStarted = false;
        //this will hold the end of the month, used to stop putting days on the calendar past that day
        int endOfMonth = end;
        //calculate leap year
        GregorianCalendar gc = new GregorianCalendar(currentYear, currentMonth-1, 1);
        if (gc.isLeapYear(currentYear) && currentMonth == 2)
        {
            //account for leap year, february should end one day later
            endOfMonth = endOfMonth + 1;
        }
        //update the buttons on the calendar with the days of the month
        for (int i = 0; i < grid.length; i++) {
            for (int j = 0; j < grid[i].length; j++) {
                //check if the month has started or j is the start day, and end once the end of the month is reached
                if ((j == startDay || monthStarted) && (startAdding <= endOfMonth)) {
                    monthStarted = true;
                    //the grid represents the day
                    grid[i][j] = startAdding;
                    //update the button to the weekday
                    
                    buttonGrid[i][j].setText(Integer.toString(startAdding));
                    //increment day
                    startAdding = startAdding + 1;
                }
                //System.out.print(grid[i][j]+ "  ");
            }
            //System.out.println("");
        }
    }