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