Package javafx.scene

Examples of javafx.scene.Parent


            logger.info("Current Locale: {}", Languages.getCurrentLocale());
            Stage settingsStage = new Stage(StageStyle.UNDECORATED);
            settingsStage.initModality(Modality.APPLICATION_MODAL);

            FXMLLoader fxmlLoader;
            Parent root;
            /* Fall back to default language if loading the FXML file files with the current locale */
            try {
                fxmlLoader = BundleUtils.getFXMLLoader("settings");
                root = (Parent) fxmlLoader.load();
            } catch (IOException e) {
View Full Code Here


        }
        return loader;
    }

    public Parent getView() {
        Parent parent = getLoader().getRoot();
        addCSSIfAvailable(parent);
        return parent;
    }
View Full Code Here

            throw new IllegalStateException("Cannot load " + conventionalName, ex);
        }
    }

    public Parent getView() {
        Parent parent = this.loader.getRoot();
        addCSSIfAvailable(parent);
        return parent;
    }
View Full Code Here

//        context = new ClassPathXmlApplicationContext("beans.xml");



        Parent root;
        root = (Parent) FXMLLoader.load(getClass().getResource("Main.fxml"));
        Scene scene = new Scene(root);
        scene.setRoot(root);
       
View Full Code Here

*/
public class TVListApp extends Application {
   
    @Override
    public void start(Stage primaryStage) throws IOException {
        Parent root = FXMLLoader.load(getClass().getResource("main_window.fxml"));
   
        Scene scene = new Scene(root, 600, 400);
//        Button btn = new Button();
//        btn.setText("Say 'Hello World'");
//        btn.setOnAction(new EventHandler<ActionEvent>() {
View Full Code Here

            application = this;
        }

        @Override
        public void start(Stage arg0) throws Exception {
            Parent root =
                    FXMLLoader
                            .load(getClass().getResource("EnvelopeTest.fxml"));
            Scene scene = new Scene(root, 800, 600);
            ObservableList<Node> children =
                    scene.getRoot().getChildrenUnmodifiable();
View Full Code Here

            throw new IllegalStateException("Cannot load " + conventionalName, ex);
        }
    }

    public Parent getView() {
        Parent parent = this.loader.getRoot();
        addCSSIfAvailable(parent);
        return parent;
    }
View Full Code Here

     *
     * @return
     */
    public Parent getView() {
        this.initializeFXMLLoader();
        Parent parent = fxmlLoader.getRoot();
        addCSSIfAvailable(parent);
        return parent;
    }
View Full Code Here

    URL url = program.getClass().getResource(program.getClass().getSimpleName() + ".fxml");
    if (url == null) {
      url = this.getClass().getResource(this.getClass().getSimpleName() + ".fxml");
    }
    Parent root = FXMLLoader.load(url, null, new ProgramBuilderFactory());

    browseButton = lookupNode(root, "#fileButton", Button.class, browseActionHandler);

    levelTextField = lookupNode(root, "#levelTextField", TextInputControl.class, levelTextActionHandler);
    if (levelTextField != null && level != null) {
      levelTextField.setText(level);
    }
    startButton = lookupNode(root, "#startButton", Button.class, levelTextActionHandler);

    inputTextField = lookupNode(root, "#inputTextField", TextInputControl.class, inputTextActionHandler);
    inputButton = lookupNode(root, "#inputButton", Button.class, inputTextActionHandler);

    messageText = lookupNode(root, "#messageText", Text.class);
    gridPane = lookupNode(root, "#gridPane", GameGridPane.class);
   
    if (gridPane != null) {
      gridPane.setFocusTraversable(true);
      keyCombinationNodes = new HashMap<KeyCombination, Node>();
      for (Node node : root.lookupAll(".keyCombinationId")) {
        keyCombinationNodes.put(KeyCombination.valueOf(node.getId().replace('_', '+')), node);
      }
      for (Node node : root.lookupAll(".inputTextButton")) {
        if (node instanceof Labeled) {
          char firstChar = ((Labeled) node).getText().charAt(0);
          KeyCharacterCombination kc = new KeyCharacterCombination(String.valueOf(firstChar));
          keyCombinationNodes.put(kc, node);
        }
      }
      gridPane.setOnKeyTyped(keyCombinationHandler);
      gridPane.setOnKeyPressed(keyCombinationHandler);
      gridPane.setOnKeyPressed(directionKeyHandler);
      gridPane.setOnMouseClicked(graphicsNodeMouseHandler);
    }

    for (Node node : root.lookupAll(".inputTextButton")) {
      setActionHandler(node, inputTextActionHandler);
    }
   
    stage.setScene(new Scene(root));
    stage.show();
View Full Code Here

  @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
    valueText = (TextInputControl) root.lookup("#valueTextNode");
   
    stage.setScene(new Scene(root));
    stage.show();
  }
View Full Code Here

TOP

Related Classes of javafx.scene.Parent

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.