A better late than never answer:
JFXDatePickerContent
is the class which is responsible for formatting all cells, days, and months in JFXDatePicker
.
There is an instance of JFXDatePickerContent
inside JFXDatePickerSkin
:
JFXDatePicker > JFXDatePickerSkin > JFXDatePickerContent
JFXDatePickerContent
provides this method:
protected Locale getLocale() {
return Locale.getDefault();
}
Although the method looks to be designed to be overridden to return a specific Locale
, the class has a package-private constructor. And here is the method that returns that content object from JFXDatePickerSkin
:
@Override
protected Node getPopupContent() {
if (content == null) {
content = new JFXDatePickerContent(jfxDatePicker);
}
return content;
}
The problem is that the private JFXDatePickerContent content
object is accessed directly (not using this getter method) inside JFXDatePickerSkin
and that means overriding this method to return another custom JFXDatePickerContent
(if it were possible) will not make everything work as expected.
Short Answer:
Use Locale.setDefault(Locale newLocale);
(if that's possible in your application).
I am not sure if the Uzbek language has a support for Cyrillic script but this is how it should be done:
Locale uzCyrl = new Locale.Builder().setLanguage("uz").setScript("Cyrl").build();
Locale.setDefault(uzCyrl);
Here is the output after setting the locale for Spanish / Spain:
Locale.setDefault(new Locale("es", "ES"));
