当前位置: 首页>>代码示例>>Java>>正文


Java JXMonthView.setLocale方法代码示例

本文整理汇总了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]));
    
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:23,代码来源:BasicMonthViewUITest.java

示例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);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:18,代码来源:BasicMonthViewUITest.java

示例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);
    }
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:14,代码来源:BasicMonthViewUITest.java

示例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);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:13,代码来源:BasicMonthViewUITest.java

示例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);
    }
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:17,代码来源:BasicMonthViewUIIssues.java


注:本文中的org.jdesktop.swingx.JXMonthView.setLocale方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。