Package javafx.fxml

Examples of javafx.fxml.FXMLLoader.load()


            // 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.
            Stage dialogStage = new Stage();
            dialogStage.initModality(Modality.APPLICATION_MODAL);
            FXMLLoader loader = new FXMLLoader(GuiUtils.class.getResource("alert.fxml"));
            Pane pane = loader.load();
            AlertWindowController controller = loader.getController();
            setup.accept(dialogStage, controller);
            dialogStage.setScene(new Scene(pane));
            dialogStage.showAndWait();
        } catch (Throwable e) {
View Full Code Here


        try {
            checkGuiThread();
            // Load the UI from disk.
            URL location = getResource(name);
            FXMLLoader loader = new FXMLLoader(location);
            Pane ui = loader.load();
            T controller = loader.getController();

            EmbeddedWindow window = null;
            if (title != null)
                ui = window = new EmbeddedWindow(title, ui);
View Full Code Here

      }
    });
   
    InputStream in = url.openStream();
    @SuppressWarnings("unchecked")
    N value = (N) loader.load(in);
    in.close();
       
    return value;
  }
}
View Full Code Here

      }

      try {
        document.set(contentData.contents);
        ByteArrayInputStream out = new ByteArrayInputStream(contentData.contents.getBytes());
        Object root = loader.load(out);
        out.close();

        Scene scene = null;
        if (root instanceof Scene) {
          scene = (Scene) root;
View Full Code Here

          scene = (Scene) root;
          rootPane_new = scene.getRoot();
        } else {
          if( contentData.previewSceneSetup != null ) {
            ByteArrayInputStream sceneOut = new ByteArrayInputStream(contentData.previewSceneSetup.getBytes());
            Object sceneRoot = loader.load(sceneOut);
            if( sceneRoot instanceof Scene ) {
              scene = (Scene) sceneRoot;
            }
          }
         
View Full Code Here

        log.info("Starting Hello JavaFX and Maven demonstration application");

        String fxmlFile = "/fxml/hello.fxml";
        log.debug("Loading FXML for main view from: {}", fxmlFile);
        FXMLLoader loader = new FXMLLoader();
        Parent rootNode = (Parent) loader.load(getClass().getResourceAsStream(fxmlFile));

        log.debug("Showing JFX scene");
        Scene scene = new Scene(rootNode, 400, 200);
        scene.getStylesheets().add("/styles/styles.css");
View Full Code Here

    controller = new DetailsViewController();
    fxmlLoader.setController(controller);

    Pane root = null;
    try {
      root = (Pane) fxmlLoader.load();
    } catch (IOException e) {
      e.printStackTrace();
    }

    parent.setCenter(root);
View Full Code Here

        loader.setControllerFactory(controllerFactory)
      }
     
      in = url.openStream();
      @SuppressWarnings("unchecked")
      O value = (O) loader.load(in);
      in.close();
     
      return value;
    } finally {
      if( in != null ) {
View Full Code Here

        public Object call(Class<?> aClass) {
          return controller;
        }
      });
      controller.setDialog(this);
      scene= new Scene((Parent) loader.load());
      setScene(scene);
    } catch (IOException e) {
      logger.error("Error loading modal class", e);
      throw new RuntimeException(e);
    }
View Full Code Here

        return control;
      }
    });
       
    try {
      return (Node) loader.load();
    } catch (Exception e) {
      logger.error("Error casting node", e);
      return null;
    }
  }
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.