2
有没有办法将JSpinner.DateEditor与佛教日历一起使用?当我将我的语言环境更改为“th”,“TH”并重新创建日历时,他们确实是佛教日历。但是,JSpinners不会更新。以下是一些示例代码:佛教日历中的JSpinner日期编辑器
Locale locale = new Locale("th", "TH");
Locale.setDefault(locale);
// Reinitializing calendars with new locale, this is done correctly
encodingCalendar = Calendar.getInstance();
expirationCalendar = Calendar.getInstance();
// Modifying the spinners in another class to update them with the correct locale
// this is the part that's not doing what I'd expect.
editor.getExpirationDateSpinner().setLocale(locale);
editor.getExpirationDateSpinner().getEditor().setLocale(locale);
任何想法?
我已经尝试过更新的语言环境,因为我张贴在我的示例代码。我尝试用新的javax.swing.SpinnerDateModel(expirationCalendar.getTime(),null,null,Calendar.MONTH)重新创建SpinnerDateModel,但那不起作用。 – Jon 2010-01-06 17:07:10
我相信你必须设置*微调器的*语言环境。我已添加SSCCE和屏幕截图。 – trashgod 2010-01-07 15:02:27