private void setRightTable() {
        Object[][] obj = new Object[24][7];
        String[] header = new String[7];
        boolean hasEvents = false;

        // set the calendar to the closest sunday for displaying
        Calendar cal = weekController.getCalendar();
        for (int i = cal.get(GregorianCalendar.DAY_OF_WEEK); i > 1; i--) {
            weekController.prevDay();
        }

        final int[][] hrs = new int[24][7];
        for (int i = 0; i < 7; i++) {
            ArrayList<DayEvents> list = events.getEventsForDate(weekController.getDate());
            if (list != null) {
                hasEvents = true;
                for (DayEvents de : list) {
                    int startHr = de.getStartHour();
                    int endHr = de.getEndHour();
                    obj[startHr][i] = de.getName();
                    while (startHr <= endHr) {
                        hrs[startHr++][i] = 1;
                    }
                }
            }
            header[i] = new String(weekController.getDayOfWeek().substring(0, 3) + " " + weekController.getCurDay() + "/" + (weekController.getCurMonth() + 1));
            weekController.nextDay();
        }
        weekController.prevDay();

        if (hasEvents) {
            rightTable = new JTable(obj, header) {
                @Override
                public Component prepareRenderer(TableCellRenderer renderer, int Index_row, int Index_col) {
                    Component comp = super.prepareRenderer(renderer, Index_row, Index_col);
                    if (hrs[Index_row][Index_col] == 1) {
                        comp.setBackground(new Color(204, 229, 255));
                    } else {
                        comp.setBackground(Color.white);
                    }
                    return comp;
                }
            };
        } else {
            rightTable = new JTable(obj, header);
        }
        rightTable.getTableHeader().setFont(new Font(rightTable.getFont().getFontName(), rightTable.getFont().getStyle(), rightTable.getFont().getSize() + 3));
        rightTable.setRowHeight(40);
        rightTable.setGridColor(Color.lightGray);
        rightTable.setEnabled(false);
    }