JXMonthView extends JComponent { public int getFirstDayOfWeek() { return firstDayOfWeek; } JXMonthView();  JXMonthView(final Locale locale);  JXMonthView(Date firstDisplayedDay);  JXMonthView(Date firstDisplayedDay, final DateSelectionModel model);  JXMonthView(Date firstDisplayedDay, final DateSelectionModel model, final Locale locale); @Override void setLocale(Locale locale); Calendar getCalendar(); TimeZone getTimeZone(); void setTimeZone(TimeZone tz); int getFirstDayOfWeek(); void setFirstDayOfWeek(int firstDayOfWeek); Date getLastDisplayedDay(); Date getFirstDisplayedDay(); void setFirstDisplayedDay(Date date); void ensureDateVisible(Date date); Date getDayAtLocation(int x, int y); Date getToday(); MonthViewUI getUI(); void setUI(MonthViewUI ui); @Override void updateUI(); @Override String getUIClassID(); DateSelectionModel getSelectionModel(); void setSelectionModel(DateSelectionModel model); void clearSelection(); boolean isSelectionEmpty(); SortedSet<Date> getSelection(); void addSelectionInterval(Date startDate, Date endDate); void setSelectionInterval(final Date startDate, final Date endDate); void removeSelectionInterval(final Date startDate, final Date endDate); SelectionMode getSelectionMode(); void setSelectionMode(final SelectionMode selectionMode); Date getFirstSelectionDate(); Date getLastSelectionDate(); Date getSelectionDate(); void setSelectionDate(Date newDate); boolean isSelected(Date date); void setLowerBound(Date lowerBound); void setUpperBound(Date upperBound); Date getLowerBound(); Date getUpperBound(); boolean isUnselectableDate(Date date); void setUnselectableDates(Date... unselectableDates); boolean isFlaggedDate(Date date); void setFlaggedDates(Date... flagged); void addFlaggedDates(Date... flagged); void removeFlaggedDates(Date... flagged); void clearFlaggedDates(); SortedSet<Date> getFlaggedDates(); boolean hasFlaggedDates(); void setShowingLeadingDays(boolean value); boolean isShowingLeadingDays(); void setShowingTrailingDays(boolean value); boolean isShowingTrailingDays(); boolean isTraversable(); void setTraversable(boolean traversable); boolean isZoomable(); void setZoomable(boolean zoomable); boolean isShowingWeekNumber(); void setShowingWeekNumber(boolean showWeekNumber); void setDaysOfTheWeek(String[] days); String[] getDaysOfTheWeek(); String getDayOfTheWeek(int dayOfWeek); int getBoxPaddingX(); void setBoxPaddingX(int boxPaddingX); int getBoxPaddingY(); void setBoxPaddingY(int boxPaddingY); Color getSelectionBackground(); void setSelectionBackground(Color c); Color getSelectionForeground(); void setSelectionForeground(Color c); Color getTodayBackground(); void setTodayBackground(Color c); Color getMonthStringBackground(); void setMonthStringBackground(Color c); Color getMonthStringForeground(); void setMonthStringForeground(Color c); void setDaysOfTheWeekForeground(Color c); Color getDaysOfTheWeekForeground(); void setDayForeground(int dayOfWeek, Color c); Color getDayForeground(int dayOfWeek); Color getPerDayOfWeekForeground(int dayOfWeek); void setFlaggedDayForeground(Color c); Color getFlaggedDayForeground(); Insets getMonthStringInsets(); void setMonthStringInsets(Insets insets); int getPreferredColumnCount(); void setPreferredColumnCount(int cols); int getPreferredRowCount(); void setPreferredRowCount(int rows); @Override void removeNotify(); @Override void addNotify(); void commitSelection(); void cancelSelection(); void setComponentInputMapEnabled(boolean enabled); boolean isComponentInputMapEnabled(); void addActionListener(ActionListener l); void removeActionListener(ActionListener l); @Override @SuppressWarnings("unchecked") T[] getListeners(Class<T> listenerType); static final String COMMIT_KEY; static final String CANCEL_KEY; static final String BOX_PADDING_X; static final String BOX_PADDING_Y; static final String DAYS_OF_THE_WEEK; static final String SELECTION_MODEL; static final String TRAVERSABLE; static final String FLAGGED_DATES; static final String uiClassID; static final int DAYS_IN_WEEK; static final int MONTHS_IN_YEAR; }
@Test public void testLocale() { Locale[] locales = Locale.getAvailableLocales(); for (Locale l : locales) { JComponent.setDefaultLocale(l); JXMonthView monthView = new JXMonthView(); Locale locale = monthView.getLocale(); Calendar cal = Calendar.getInstance(locale); int expectedFirstDayOfWeek = cal.getFirstDayOfWeek(); assertTrue(expectedFirstDayOfWeek == monthView.getFirstDayOfWeek()); } }