-1

My program runs everything correctly within the IDE with the language I chose, but when installing the program and running it on the computer, the language of the days changes to English, all this within the column

The method to change the format of the column is: `

public void Formato_fecha_y_hora(){
    Locale locale = new Locale("es", "ES");
    DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy E").withLocale(locale);
    Col_FEentrega.setCellFactory(tc -> new TableCell<>() {
        @Override
        protected void updateItem(LocalDate date, boolean empty) {
            super.updateItem(date, empty);
            if (empty) {
                setText(null);
            } else {
                setText(formatter.format(date));
            }
        }
    });

    DateTimeFormatter formato_hora = DateTimeFormatter.ofPattern("h:mm a");
    Col_Hora_entrega.setCellFactory(tc -> new TableCell<>() {
        @Override
        protected void updateItem(LocalTime Time, boolean empty) {
            super.updateItem(Time, empty);
            if (empty) {
                setText(null);
            } else {
                setText(formato_hora.format(Time));
            }
        }
    });
}

To make the installer use the following jpackage:

jpackage --type exe --input . --dest . --main-jar .\Dulceria.jar --main-class com.example.dulceria.HelloApplication --module-path "D:\Program Files\Java\javafx-jmods-18" --add-modules javafx.controls,javafx.fxml,java.sql,java.sql.rowset --win-shortcut --win-menu

I get the following form in the .exe

I want the names of the days to look like this

2 Answers2

1

The answer was provided to me in the comments, as mentioned by mr mcwolf I needed to add the jdk.localedata module in the image

0

You can use Locale.getDefault() which, based on the documentation, it will use the locale of the JVM:

Gets the current value of the default locale for this instance of the Java Virtual Machine. The Java Virtual Machine sets the default locale during startup based on the host environment. It is used by many locale-sensitive methods if no locale is explicitly specified. It can be changed using the setDefault method.