package datepickersample; import com.sun.javafx.runtime.VersionInfo; import java.util.Locale; import java.util.Locale; import javafx.application.Application; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.DatePicker; import javafx.scene.control.Label; import javafx.scene.layout.HBox; import javafx.scene.layout.VBox; import javafx.stage.Stage; public class DatePickerSample extends Application { static { Locale.setDefault(Locale.ENGLISH); } Button switchLocale; public static void main(String[] args) { launch(args); } @Override public void start(Stage stage) throws Exception { stage.setTitle(VersionInfo.getRuntimeVersion()); stage.setScene(createScene()); stage.show(); } private Scene createScene() { switchLocale = new Button("Switch locale"); switchLocale.setOnAction(new EventHandler() { @Override public void handle(ActionEvent event) { if (Locale.getDefault() == Locale.ENGLISH) { Locale.setDefault(Locale.FRANCE); } else { Locale.setDefault(Locale.ENGLISH); } } }); return new Scene(new HBox(5, new DatePicker(), new VBox(3, new Label("Test"), new Button("Button"), switchLocale)), 300, 200); } }