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);
}
}
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);
}
}
- relates to
-
JDK-8093147 [Quantum] Control ActionEvent is fired on Stage closing and the App hangs if modal window is then shown
- Resolved