Examples of FXMLLoader


Examples of javafx.fxml.FXMLLoader

        this.controller = controller;
    }

    @Override
    protected Node createRootNode() throws NodeCreationException {
        fxmlLoader = new FXMLLoader();
        fxmlLoader.setLocation(url);
        fxmlLoader.setController(controller);
        try {
            return (Node) fxmlLoader.load();
        } catch (IOException e) {
View Full Code Here

Examples of javafx.fxml.FXMLLoader

    private void init() {
        try {
            ResourceBundle resourceBundle = ResourceBundle.getBundle("i18n/messages");
            URL fxmlURL = getClass().getResource("/fxml/iconsdemo.fxml");
            FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, resourceBundle);
            fxmlLoader.setRoot(this);
            fxmlLoader.setController(this);
            fxmlLoader.load();
        } catch (IOException ex) {
            Logger.getLogger(IconsFXMLDemo.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
View Full Code Here

Examples of javafx.fxml.FXMLLoader

    private void init() {
        try {
            ResourceBundle resourceBundle = ResourceBundle.getBundle("i18n/messages");
            URL fxmlURL = getClass().getResource("/fxml/iconsbrowser.fxml");
            FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, resourceBundle);
            fxmlLoader.setRoot(this);
            fxmlLoader.setController(this);
            fxmlLoader.load();
        } catch (IOException ex) {
            Logger.getLogger(IconsBrowser.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
View Full Code Here

Examples of javafx.fxml.FXMLLoader

   * @param controllerClass Controller class
   * @return PaneInfo instance
   */
  public static <T> PaneInfo<T> loadPane(URL paneFxmlUrl, Class<T> controllerClass) {
    try {
      FXMLLoader loader = new FXMLLoader(paneFxmlUrl);
      Pane pane = (Pane)loader.load();
      T controller = loader.getController();
      return new PaneInfo<T>(pane, controller);
    } catch (Exception ex) {
      throw new JuRuntimeException("Couldn't load pane from URL " + paneFxmlUrl, ex);
    }
  }
View Full Code Here

Examples of javafx.fxml.FXMLLoader

    }

    private void init() {

        ResourceBundle resourceBundle = ResourceBundle.getBundle(getClass().getPackage().getName() + ".ioboard");
        FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("ioboard.fxml"));
        fxmlLoader.setResources(resourceBundle);
        fxmlLoader.setRoot(this);
        fxmlLoader.setController(this);
        try {
            fxmlLoader.load();
        } catch (IOException ex) {
            LOGGER.log(Level.SEVERE, null, ex);
        }

        AwesomeDude.setIcon(exitButton, AwesomeIcon.POWER_OFF, "2em");
View Full Code Here

Examples of javafx.fxml.FXMLLoader

  public Object load(String url) {
    try {
      InputStream fxmlStream = SpringFxmlLoader.class.getResourceAsStream(url);
      System.err.println(SpringFxmlLoader.class.getResourceAsStream(url));
      FXMLLoader loader = new FXMLLoader();
      loader.setControllerFactory(new Callback<Class<?>, Object>() {
        @Override
        public Object call(Class<?> clazz) {
          return applicationContext.getBean(clazz);
        }
      });
      return loader.load(fxmlStream);
    } catch (IOException ioException) {
      throw new RuntimeException(ioException);
    }
  }
View Full Code Here

Examples of javafx.fxml.FXMLLoader

  public Scene createScene() {
    ClassLoader theClassLoader = getClass().getClassLoader();
    if (null != this.classLoader) {
      theClassLoader = this.classLoader;
    }
    FXMLLoader loader = new FXMLLoader();
    loader.setClassLoader(theClassLoader);
    InputStream is = null;
    try {
      is = theClassLoader
          .getResource(
              "dsk/php_export/plugin/desktop/javafx/application/selectPackages.fxml")
          .openConnection().getInputStream();
      loader.load(is);
      this.controller = loader.getController();
    } catch (IOException e) {
      throw new DskRuntimeException("fxmlの指定が不正です", e);
    } finally {
      IoTools.close(is);
    }
    Parent root = loader.getRoot();
    Scene scene = new Scene(root);
    return scene;
  }
View Full Code Here

Examples of javafx.fxml.FXMLLoader

    @FXML protected Label copyWidget;
    @FXML protected Label qrCode;

    public ClickableBitcoinAddress() {
        try {
            FXMLLoader loader = new FXMLLoader(getClass().getResource("bitcoin_address.fxml"));
            loader.setRoot(this);
            loader.setController(this);
            // The following line is supposed to help Scene Builder, although it doesn't seem to be needed for me.
            loader.setClassLoader(getClass().getClassLoader());
            loader.load();

            AwesomeDude.setIcon(copyWidget, AwesomeIcon.COPY);
            Tooltip.install(copyWidget, new Tooltip("Copy address to clipboard"));

            AwesomeDude.setIcon(qrCode, AwesomeIcon.QRCODE);
View Full Code Here

Examples of javafx.fxml.FXMLLoader

    private static final Logger LOGGER = LoggerFactory.getLogger(SpringFXMLLoader.class);
    private static final ApplicationContext APPLICATION_CONTEXT = new AnnotationConfigApplicationContext(ApplicationConfig.class);

    public static Controller load(String url) {
        try (InputStream fxmlStream = SpringFXMLLoader.class.getResourceAsStream(url)) {
            FXMLLoader loader = new FXMLLoader();
            loader.setControllerFactory(aClass -> APPLICATION_CONTEXT.getBean(aClass));

            Node view = loader.load(fxmlStream);
            Controller controller = loader.getController();
            controller.setView(view);

            return controller;
        } catch (IOException e) {
            LOGGER.error("Can't load resource", e);
View Full Code Here

Examples of javafx.fxml.FXMLLoader

        });
    }


    protected Node loadFxml() throws NodeCreationException {
        fxmlLoader = new FXMLLoader();
        fxmlLoader.setLocation(url);
        fxmlLoader.setController(controller);
        try {
            return (Node) fxmlLoader.load();
        } catch (IOException e) {
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.