本文整理汇总了Java中org.jdesktop.swingx.JXMonthView.DAYS_IN_WEEK属性的典型用法代码示例。如果您正苦于以下问题:Java JXMonthView.DAYS_IN_WEEK属性的具体用法?Java JXMonthView.DAYS_IN_WEEK怎么用?Java JXMonthView.DAYS_IN_WEEK使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.jdesktop.swingx.JXMonthView
的用法示例。
在下文中一共展示了JXMonthView.DAYS_IN_WEEK属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateLocale
/**
* Updates internal state according to monthView's locale. Revalidates the
* monthView if the boolean parameter is true.
*
* @param revalidate a boolean indicating whether the monthView should be
* revalidated after the change.
*/
protected void updateLocale(boolean revalidate) {
Locale locale = monthView.getLocale();
if (getRenderingHandler() != null) {
getRenderingHandler().setLocale(locale);
}
// fixed JW: respect property in UIManager if available
// PENDING JW: what to do if weekdays had been set
// with JXMonthView method? how to detect?
daysOfTheWeek = (String[]) UIManager.get("JXMonthView.daysOfTheWeek");
if (daysOfTheWeek == null) {
daysOfTheWeek = new String[7];
String[] dateFormatSymbols = DateFormatSymbols.getInstance(locale)
.getShortWeekdays();
daysOfTheWeek = new String[JXMonthView.DAYS_IN_WEEK];
for (int i = Calendar.SUNDAY; i <= Calendar.SATURDAY; i++) {
daysOfTheWeek[i - 1] = dateFormatSymbols[i];
}
}
if (revalidate) {
monthView.invalidate();
monthView.validate();
}
}
示例2: updateLocale
/**
* Updates internal state according to monthView's locale. Revalidates the
* monthView if the boolean parameter is true.
*
* @param revalidate a boolean indicating whether the monthView should be
* revalidated after the change.
*/
protected void updateLocale(boolean revalidate) {
Locale locale = monthView.getLocale();
if (renderingHandler != null) {
renderingHandler.setLocale(locale);
}
monthsOfTheYear = new DateFormatSymbols(locale).getMonths();
// fixed JW: respect property in UIManager if available
// PENDING JW: what to do if weekdays had been set
// with JXMonthView method? how to detect?
daysOfTheWeek = (String[]) UIManager.get("JXMonthView.daysOfTheWeek");
if (daysOfTheWeek == null) {
daysOfTheWeek = new String[7];
String[] dateFormatSymbols = new DateFormatSymbols(locale)
.getShortWeekdays();
daysOfTheWeek = new String[JXMonthView.DAYS_IN_WEEK];
for (int i = Calendar.SUNDAY; i <= Calendar.SATURDAY; i++) {
daysOfTheWeek[i - 1] = dateFormatSymbols[i];
}
}
if (revalidate) {
monthView.invalidate();
monthView.validate();
}
}