Package javafx.fxml

Examples of javafx.fxml.FXMLLoader.load()


                @Override
                public Object call(Class<?> aClass) {
                    return applicationContext.getBean(aClass);
                }
            });
            dialog.setScene(new Scene((Parent) loader.load()));
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        return dialog;
    }
View Full Code Here


                public Object call(Class<?> aClass) {
                    return controller;
                }
            });
            controller.setDialog(this);
            setScene(new Scene((Parent) loader.load()));
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
View Full Code Here

        try {
            error = fxmlLoader.getLocation() == null;
            if (error) {
                node = TextBuilder.create().text(FXML_ERROR_NODE_LABEL.getText(fxmlPath)).build();
            } else {
                node = (Node) fxmlLoader.load(fxmlLoader.getLocation().openStream());
            }

        } catch (final IOException e) {
            throw new CoreRuntimeException(FXML_NODE_DOESNT_EXIST.getText(fxmlPath), e);
        }
View Full Code Here

   * @param closeStream
   *            close the stream after processing
   */
  public void load(InputStream fxml, boolean closeStream) throws Exception {
    FXMLLoader loader = new FXMLLoader();
    fxmlRoot = loader.load(fxml);
    if (closeStream)
      fxml.close();
  }
}
View Full Code Here

  @Test
  public void testLoading() throws Exception {
    InputStream fxml =  LanguagesBasicDemo.class.getResourceAsStream("LanguagesBasicDemoConfiguration.fxml");
    Assert.assertNotNull(fxml);
    FXMLLoader loader = new FXMLLoader();
    Object root = loader.load(fxml);
    Assert.assertNotNull(root);
   
   
  }
View Full Code Here

            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

            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

   * @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

        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

        @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

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.