Examples of initModality()


Examples of javafx.stage.Stage.initModality()

   * @return the alert
   */
  public static Stage alert(final Stage parent, final double width, final double height,
      final Modality modality, final Node... children) {
    final Stage stage = new Stage();
    stage.initModality(modality);
    stage.initStyle(StageStyle.TRANSPARENT);
    final StackPane root = new StackPane();
    root.setPrefSize(width, height);
    if (children != null) {
      root.getChildren().addAll(children);
View Full Code Here

Examples of javafx.stage.Stage.initModality()

   */
  public static DialogService dialogService(final Stage parent, final KEY titleKey, final String headerText,
      final KEY submitLabelKey, final double width, final double height, final Service<Void> submitService,
      final Modality modality, final Node... children) {
    final Stage window = new Stage();
    window.initModality(modality);
    final Button submitBtn = ButtonBuilder.create().text(RS.rbLabel(submitLabelKey == null ? KEY.SUBMIT :
      submitLabelKey)).defaultButton(true).onAction(new EventHandler<ActionEvent>() {
      @Override
      public void handle(final ActionEvent actionEvent) {
        submitService.restart();
View Full Code Here

Examples of javafx.stage.Stage.initModality()

        final Scene scene = new Scene(root);
        scene.getStylesheets().add("stylesheet.css");
        final Stage stage = new Stage();
        stage.setScene(scene);
        stage.setResizable(false);
        stage.initModality(Modality.APPLICATION_MODAL);
        stage.setTitle(ResourceLoader.getResource("label.title.createLeague"));
        stage.show();
    }
}
View Full Code Here

Examples of javafx.stage.Stage.initModality()

        final Scene scene = new Scene(root);
        scene.getStylesheets().add("stylesheet.css");
        final Stage stage = new Stage();
        stage.setScene(scene);
        stage.setResizable(false);
        stage.initModality(Modality.APPLICATION_MODAL);
        stage.setTitle(ResourceLoader.getResource(TITLE_CREATE_LEAGUE));
        stage.show();
    }

    public void editFixture(final ActionEvent event) {
View Full Code Here

Examples of javafx.stage.Stage.initModality()

    }

    @Override
    public Stage get() {
        Stage dialog = new Stage(style);
        dialog.initModality(Modality.WINDOW_MODAL);
        dialog.initOwner(CustomerApp.getPrimaryStage());
        try {
            FXMLLoader loader = new FXMLLoader(fxml);
            loader.setControllerFactory(new Callback<Class<?>, Object>() {
                @Override
View Full Code Here

Examples of javafx.stage.Stage.initModality()

         
          Scene scene = new Scene(flowPane);
         
          Stage stage = new Stage(StageStyle.UTILITY);
          stage.setTitle("Hello there");
          stage.initModality(Modality.APPLICATION_MODAL);
          stage.setScene(scene);
          stage.sizeToScene();
          stage.showAndWait();
        }
      })
View Full Code Here

Examples of javafx.stage.Stage.initModality()

     * @param parent Parent of the dialog, used to center the dialog. May be null.
     */
    public void showModal(final Node parent) {
      Stage stage = new Stage();
      stage.setScene(new Scene(pane));     
      stage.initModality(Modality.APPLICATION_MODAL);
      stage.setTitle(title);
     
      // We need to apply the size after the stage is visible, otherwise we won't get any
      // usable preferred size information.
      stage.setOnShown(new EventHandler<WindowEvent>() {
View Full Code Here

Examples of javafx.stage.Stage.initModality()

        primaryStage.setTitle("Fly app");
        primaryStage.setScene(scene);
        primaryStage.show();

        final Stage dialog = new Stage(StageStyle.TRANSPARENT);
        dialog.initModality(Modality.WINDOW_MODAL);
        dialog.initOwner(primaryStage);
        dialog.setScene(new Scene((Parent) SpringFXMLLoader.load("/fxml/login.fxml").getView()));
//        dialog.show();
    }
}
View Full Code Here

Examples of javafx.stage.Stage.initModality()

    public static void runAlert(BiConsumer<Stage, AlertWindowController> setup) {
        // JavaFX doesn't actually have a standard alert template. Instead the Scene Builder app will create FXML
        // files for an alert window for you, and then you customise it as you see fit. I guess it makes sense in
        // an odd sort of way.
        Stage dialogStage = new Stage();
        dialogStage.initModality(Modality.APPLICATION_MODAL);
        FXMLLoader loader = new FXMLLoader(GuiUtils.class.getResource("alert.fxml"));
        Pane pane = evalUnchecked(() -> (Pane) loader.load());
        AlertWindowController controller = loader.getController();
        setup.accept(dialogStage, controller);
        dialogStage.setScene(new Scene(pane));
View Full Code Here

Examples of javafx.stage.Stage.initModality()

        stage.getIcons().add(new Image(getClass().getResourceAsStream("/public/favicon.ico")));

        Stage tableStage = new Stage();
        tableStage.setScene(new Scene(tableAnchor));
        tableStage.setTitle("Table Generator");
        tableStage.initModality(Modality.WINDOW_MODAL);
        tableStage.initOwner(scene.getWindow());

        controller.setStage(stage);
        controller.setScene(scene);
        controller.setTableAnchor(tableAnchor);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.