Home Ask Login Register

Developers Planet

Your answer is one click away!

Null Pointer February 2016

Java Unsupported Locale (JCalendar)

I'm developing a desktop application with Swing for an unsupported language.

I have my own properties file. I'm using it for the messages in the application. I also call setLocale() method of the JCalendar with my file. But since I don't know which keywords to use for months, month selection inside the JCalendar shows English named months.

For example, I tried:


I couldn't find a tutorial or form to fill to create a locale (properties) file. Is there one? Or is it still impossible for JCalendar to get words from properties file. Or simply, what is the necessary keywords?


VGR February 2016

Looking at the source of the initNames() method in JCalendar's JMonthChooser class, we see:

DateFormatSymbols dateFormatSymbols = new DateFormatSymbols(locale);
String[] monthNames = dateFormatSymbols.getMonths();

So, you can't override the names with your own ResourceBundle entries. The best you can do is hope that Java SE defines month names for the locale you pass to setLocale.

Post Status

Asked in February 2016
Viewed 2,984 times
Voted 5
Answered 1 times


Leave an answer

Quote of the day: live life