public static void refreshCalendar(int month, int year) {
        //Month variables.
        String[] months = {"January", "February", "March", "April", "May", "June", 
            "July", "August", "September", "October", "November", "December"};
        int numberOfDays, startOfMonth;
        
        //Allow and disallow buttons.
        buttonPrevious.setEnabled(true);
        buttonNext.setEnabled(true);
        
        if (month == 0 && year <= realYear-10) {
            buttonPrevious.setEnabled(false); //Too early.
        }
        if (month == 11 && year >= realYear+100) {
            buttonNext.setEnabled(false); // Too late.
        }
        
        labelMonth.setText(months[month]); 
        //Refreshing month labels...
        
        labelMonth.setBounds(160-labelMonth.getPreferredSize().width/2, 25, 180, 25); 
        //Realignment with calendar!
        
        comboYear.setSelectedItem(String.valueOf(year));
        
        //Clearing table...
        for (int i=0; i<6; i++) {
            for (int j=0; j<7; j++) {
                tableModelCalendar.setValueAt(null, i, j);
            }
        }
        
        //Get the first day of the month and number of days.
        GregorianCalendar cal = new GregorianCalendar(year, month, 1);
        numberOfDays = cal.getActualMaximum(GregorianCalendar.DAY_OF_MONTH);
        startOfMonth = cal.get(GregorianCalendar.DAY_OF_WEEK);
        
        for (int i=1; i<numberOfDays; i++) {
            int row = new Integer((i+startOfMonth-2)/7);
            int column = (i+startOfMonth-2)%7;
            tableModelCalendar.setValueAt(i, row, column);
        }
        
        //Apply renderers...
        tableCalendar.setDefaultRenderer(tableCalendar.getColumnClass(0), new tableCalendarRenderer());
    }