Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8097293

[DatePicker] Does not change to new selected value if modal window is shown in DatePicker-action

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 8u40
    • 8u20
    • javafx
    • Windows 7 64bit, JDK 8u20 Build b23

      A modal window is shown when changing the value of the DatePicker. Because of that the value of the DatePicker could not be changed.


      import java.time.LocalDate;
      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.DatePicker;
      import javafx.scene.layout.VBox;
      import javafx.stage.FileChooser;
      import javafx.stage.Stage;

      public class Test extends Application {

      @Override
      public void start(Stage stage) throws Exception {
      DatePicker datePicker = new DatePicker(LocalDate.now());
      stage.setScene(new Scene(new VBox(datePicker), 300, 200));
      stage.show();

      datePicker.setOnAction(e -> {
      if (stage.isShowing()) {
      new FileChooser().showOpenDialog(stage);
      }
      });
      }

      public static void main(String[] args) {
      launch(args);
      }

      }

            msladecek Martin Sládeček
            aliebelt Andreas Liebelt
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: