Package javafx.fxml

Examples of javafx.fxml.FXMLLoader


    stage.setScene(scene);
    stage.show();
  }
 
  public void fisher() throws IOException {
    FXMLLoader loader = new FXMLLoader(
        JBot.class.getResource("Fisher.fxml"));
    AnchorPane aPane = (AnchorPane) loader.load();
    Stage stage = new Stage();
    stage.initStyle(StageStyle.DECORATED);
    Scene scene = new Scene(aPane);
    stage.setScene(scene);
    stage.show();
View Full Code Here


  public void start(Stage primaryStage) {
    this.primaryStage = primaryStage;
    this.primaryStage.setTitle("jBot");

    try {
      FXMLLoader loader = new FXMLLoader(
          JBot.class.getResource("Main.fxml"));
      rootLayout = (AnchorPane) loader.load();
      Scene scene = new Scene(rootLayout);
      primaryStage.setScene(scene);
      primaryStage.show();
      primaryStage.setResizable(false);   
      scene.setOnKeyPressed(new EventHandler<KeyEvent>() {
View Full Code Here

    stage.setScene(scene);
    stage.show();
  }

  public void spellCaster() throws IOException {
    FXMLLoader loader = new FXMLLoader(
        JBot.class.getResource("SpellCaster.fxml"));
    AnchorPane aPane = (AnchorPane) loader.load();
    Stage stage = new Stage();
    stage.initStyle(StageStyle.DECORATED);
    Scene scene = new Scene(aPane);
    stage.setScene(scene);
    stage.show();
View Full Code Here

    delay.setText(prop.getProperty("fishDelay"));
    times.setText(prop.getProperty("times"));
  }
 
  public void selectRod() throws IOException, AWTException {
    FXMLLoader loader = new FXMLLoader(
        JBot.class.getResource("Select.fxml"));
    AnchorPane selectDialog = (AnchorPane) loader.load();
    final Stage stage = new Stage();
    stage.initStyle(StageStyle.TRANSPARENT);
    Scene scene = new Scene(selectDialog);
    stage.setScene(scene);
    stage.setOpacity(0.1);
View Full Code Here

      }
    });
  }
 
  public void selectWater() throws IOException {
    FXMLLoader loader = new FXMLLoader(
        JBot.class.getResource("Select.fxml"));
    AnchorPane selectDialog = (AnchorPane) loader.load();
    final Stage stage = new Stage();
    stage.initStyle(StageStyle.TRANSPARENT);
    Scene scene = new Scene(selectDialog);
    stage.setScene(scene);
    stage.setOpacity(0.1);
View Full Code Here

    static public void construct(Node n, String fxmlFileName) {
        final String name = "nbres:/" + StringUtils.replace(n.getClass().getPackage().getName(), ".", "/") + "/" + fxmlFileName;
//        System.out.println(name);

        try {
            FXMLLoader fxmlLoader = new FXMLLoader(new URL(name));
            fxmlLoader.setRoot(n);
            fxmlLoader.setController(n);

            try {
                fxmlLoader.load();
            } catch (IOException exception) {
                try {
                    fxmlLoader.setClassLoader(FXMLLoader.getDefaultClassLoader());
                    fxmlLoader.load();
                } catch (IOException ex) {
                    Exceptions.printStackTrace(ex);
                }
            }
        } catch (MalformedURLException ex) {
View Full Code Here

        staleLabel.visibleProperty().bind(controller.stale());
    }

    public StatusBar(ImageAnalyzerController controller) {
        this.controller = controller;
        FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("StatusBar.fxml"));
        fxmlLoader.setRoot(this);
        fxmlLoader.setController(this);

        try {
            fxmlLoader.load();
        } catch (IOException exception) {
            throw new RuntimeException(exception);
        }

    }
View Full Code Here

    }

    public MetaDataPane(ImageAnalyzerController controller) {
        this.controller = controller;

        FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("MetaDataPane.fxml"));
        fxmlLoader.setRoot(this);
        fxmlLoader.setController(this);

        try {
            fxmlLoader.load();
        } catch (IOException exception) {
            throw new RuntimeException(exception);
        }
    }
View Full Code Here

    static public void construct(Node n, String fxmlFileName) {
        final String name = "nbres:/" + StringUtils.replace(n.getClass().getPackage().getName(), ".", "/") + "/" + fxmlFileName;
        System.out.println(name);

        try {
            FXMLLoader fxmlLoader = new FXMLLoader(new URL(name));
            fxmlLoader.setRoot(n);
            fxmlLoader.setController(n);

            try {
                fxmlLoader.load();
            } catch (IOException exception) {
                try {
                    fxmlLoader.setClassLoader(FXMLLoader.getDefaultClassLoader());
                    fxmlLoader.load();
                } catch (IOException ex) {
                    Exceptions.printStackTrace(ex);
                }
            }
        } catch (MalformedURLException ex) {
View Full Code Here

  private String fxmlFile = "RPN.fxml";

  @Override
  public void start(Stage stage) throws Exception {
    FXMLLoader fxmlLoader = new FXMLLoader();
    fxmlLoader.setLocation(getClass().getResource(fxmlFile));
    fxmlLoader.load(getClass().getResourceAsStream(fxmlFile));
    Parent root = fxmlLoader.<Parent>getRoot();
   
    for (Node node : root.lookupAll("Button")) {
      node.addEventHandler(ActionEvent.ACTION, this);
    }
    // the node holding the current value, using id lookup
View Full Code Here

TOP

Related Classes of javafx.fxml.FXMLLoader

Copyright © 2018 www.massapicom. 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.