本文整理汇总了Java中org.jdesktop.swingx.JXMonthView.setLocale方法的典型用法代码示例。如果您正苦于以下问题:Java JXMonthView.setLocale方法的具体用法?Java JXMonthView.setLocale怎么用?Java JXMonthView.setLocale使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jdesktop.swingx.JXMonthView
的用法示例。
在下文中一共展示了JXMonthView.setLocale方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testLocaleByProviderMonthRendering
import org.jdesktop.swingx.JXMonthView; //导入方法依赖的package包/类
@Test
public void testLocaleByProviderMonthRendering() {
Locale serbianLatin = getLocal("sh");
if (serbianLatin == null) {
LOG.fine("can't run, no service provider for serbian latin" );
return;
}
JXMonthView monthView = new JXMonthView();
monthView.setLocale(serbianLatin);
Calendar calendar = monthView.getCalendar();
int month = calendar.get(Calendar.MONTH);
BasicMonthViewUI ui = (BasicMonthViewUI) monthView.getUI();
CalendarRenderingHandler handler = ui.getRenderingHandler();
JComponent component = handler.prepareRenderingComponent(monthView,
calendar, CalendarState.TITLE);
String[] monthNames = DateFormatSymbols.getInstance(monthView.getLocale()).getMonths();
String title = ((JLabel) component).getText();
assertTrue("name must be taken from Locale, expected: " + monthNames[month] + " was: " + title,
title.startsWith(monthNames[month]));
}
示例2: testLocaleByProviderDayOfTheWeekName
import org.jdesktop.swingx.JXMonthView; //导入方法依赖的package包/类
/**
* Issue #1245-swingx: incorrect month/dayofweek names for non-core-supported Locales.
*/
@Test
public void testLocaleByProviderDayOfTheWeekName() {
if (UIManager.get("JXMonthView.daysOfTheWeek") != null) {
LOG.fine("can't test, custom daysoftheweek");
}
Locale serbianLatin = getLocal("sh");
if (serbianLatin == null) {
LOG.fine("can't run, no service provider for serbian latin" );
return;
}
JXMonthView monthView = new JXMonthView();
monthView.setLocale(serbianLatin);
assertWeekdays(monthView, serbianLatin);
}
示例3: testCustomWeekdays
import org.jdesktop.swingx.JXMonthView; //导入方法依赖的package包/类
@Test
public void testCustomWeekdays() {
String[] days = new String[] {"1", "2", "3", "4", "5", "6", "7"};
UIManager.put("JXMonthView.daysOfTheWeek", days);
JXMonthView monthView = new JXMonthView(Locale.GERMAN);
try {
assertWeekdays(monthView, days);
monthView.setLocale(Locale.FRENCH);
assertWeekdays(monthView, days);
} finally {
UIManager.put("JXMonthView.daysOfTheWeek", null);
}
}
示例4: testLocaleWeekdays
import org.jdesktop.swingx.JXMonthView; //导入方法依赖的package包/类
/**
* test localized weekday names.
*/
@Test
public void testLocaleWeekdays() {
Locale french = Locale.FRENCH;
JXMonthView monthView = new JXMonthView(french);
assertWeekdays(monthView, french);
Locale german = Locale.GERMAN;
monthView.setLocale(german);
assertWeekdays(monthView, german);
}
示例5: testLocaleByProviderUIMonthNames
import org.jdesktop.swingx.JXMonthView; //导入方法依赖的package包/类
/**
* Issue #1245-swingx: incorrect month/dayofweek names for non-core-supported Locales.
*/
@Test
public void testLocaleByProviderUIMonthNames() {
fail("TBD: need test that Locales from service providers are used");
Locale serbianLatin = getLocal("sh");
if (serbianLatin == null) {
LOG.fine("can't run, no service provider for serbian latin" );
return;
}
JXMonthView monthView = new JXMonthView();
monthView.setLocale(serbianLatin);
// deprecation removal
// assertMonths(monthView, serbianLatin);
}