Example usage for javafx.scene.layout VBox getChildren

List of usage examples for javafx.scene.layout VBox getChildren

Introduction

In this page you can find the example usage for javafx.scene.layout VBox getChildren.

Prototype

@Override
public ObservableList<Node> getChildren() 

Source Link

Usage

From source file:Main.java

@Override
public void start(Stage stage) {
    msgLbl.setPrefWidth(150);/* ww w .j  ava 2 s .c o m*/

    sayHelloBtn.setOnAction(this::sayHello);

    VBox root = new VBox(10);
    root.getChildren().addAll(msgLbl, sayHelloBtn);
    root.setStyle("-fx-padding: 10;" + "-fx-border-style: solid inside;" + "-fx-border-width: 2;"
            + "-fx-border-insets: 5;" + "-fx-border-radius: 5;" + "-fx-border-color: blue;");
    Scene scene = new Scene(root);
    stage.setScene(scene);
    stage.setTitle("Hello FXML");
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Button b1 = new Button("Close");
    b1.setEffect(new DropShadow());

    Button b3 = new Button("Close");
    b3.setEffect(new DropShadow());
    b3.setRotate(30);/*from ww w .  ja va2 s. com*/

    VBox root = new VBox();
    root.getChildren().addAll(b1, b3);

    Scene scene = new Scene(root);
    stage.setScene(scene);
    stage.setTitle("Testing LayoutBounds");
    stage.show();

    System.out.println("b1=" + b1.getLayoutBounds());
    System.out.println("b3=" + b3.getLayoutBounds());
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Button b1 = new Button("Close");
    b1.setEffect(new DropShadow());

    Button b2 = new Button("Close");

    Button b3 = new Button("Close");
    b3.setEffect(new DropShadow());
    b3.setRotate(30);/* ww  w  .j  ava 2s  .  c o m*/

    Button b4 = new Button("Close");

    VBox root = new VBox();
    root.getChildren().addAll(b1, b2, b3, b4);

    Scene scene = new Scene(root);
    stage.setScene(scene);
    stage.setTitle("Testing LayoutBounds");
    stage.show();

}

From source file:Main.java

@Override
public void start(Stage stage) {
    Button okBtn = new Button("OK");
    Button cancelBtn = new Button("Cancel");

    cancelBtn.setPrefWidth(100);/*from w w w.  j  a  v a2s  .c  o m*/

    VBox root = new VBox();
    root.getChildren().addAll(okBtn, cancelBtn);

    Scene scene = new Scene(root);
    stage.setScene(scene);
    stage.setTitle("Overriding Node Sizes");
    stage.show();

    System.out.println("okBtn.getPrefWidth(): " + okBtn.getPrefWidth());
    System.out.println("okBtn.getMinWidth(): " + okBtn.getMinWidth());
    System.out.println("okBtn.getMaxWidth(): " + okBtn.getMaxWidth());

    System.out.println("cancelBtn.getPrefWidth(): " + cancelBtn.getPrefWidth());
    System.out.println("cancelBtn.getMinWidth(): " + cancelBtn.getMinWidth());
    System.out.println("cancelBtn.getMaxWidth(): " + cancelBtn.getMaxWidth());
}

From source file:Main.java

@Override
public void start(final Stage stage) {
    stage.setTitle("HTML");
    stage.setWidth(500);/*from  w w w  .j a  va  2  s. co  m*/
    stage.setHeight(500);
    Scene scene = new Scene(new Group());

    VBox vbox = new VBox(8); // spacing = 8
    vbox.getChildren().addAll(new Button("Cut"), new Button("Copy"), new Button("Paste"));

    scene.setRoot(vbox);

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

From source file:Main.java

@Override
public void start(Stage stage) {
    Scene scene = new Scene(new Group());
    stage.setTitle("Checkbox Sample");
    stage.setWidth(230);//from  ww w.  j av a  2s . c  o  m
    stage.setHeight(120);

    Path path = new Path();
    path.getElements().add(new MoveTo(0.0f, 50.0f));
    path.getElements().add(new LineTo(100.0f, 100.0f));

    VBox vbox = new VBox();
    vbox.getChildren().addAll(path);
    vbox.setSpacing(5);

    HBox root = new HBox();
    root.getChildren().add(vbox);
    root.setSpacing(40);
    root.setPadding(new Insets(20, 10, 10, 20));

    ((Group) scene.getRoot()).getChildren().add(root);

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

From source file:Main.java

@Override
public void start(final Stage stage) {
    stage.setTitle("HTML");
    stage.setWidth(500);//from ww w  .  j  a  v  a  2  s .com
    stage.setHeight(500);
    Scene scene = new Scene(new Group());
 
    VBox vbox = new VBox(8); // spacing = 8
    vbox.getChildren().addAll(new Button("Cut"), new Button("Copy"), new Button("Paste"));
        
    scene.setRoot(vbox);

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

From source file:Main.java

@Override
public void start(Stage stage) {
    Scene scene = new Scene(new Group());
    stage.setTitle("");
    stage.setWidth(230);/*from  ww  w  .j  a v  a  2  s  . c  o m*/
    stage.setHeight(120);

    Path path = new Path();
    path.getElements().add(new MoveTo(0.0f, 50.0f));
    path.getElements().add(new LineTo(100.0f, 100.0f));

    VBox vbox = new VBox();
    vbox.getChildren().addAll(path);
    vbox.setSpacing(5);

    HBox root = new HBox();
    root.getChildren().add(vbox);
    root.setSpacing(40);
    root.setPadding(new Insets(20, 10, 10, 20));

    ((Group) scene.getRoot()).getChildren().add(root);

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

From source file:Main.java

@Override
    public void start(Stage primaryStage) {
        TextArea myTextArea = new TextArea();
        VBox hbox = new VBox();
        hbox.getChildren().add(myTextArea);
        VBox.setVgrow(myTextArea, Priority.ALWAYS);

        Scene scene = new Scene(hbox, 320, 112, Color.rgb(0, 0, 0, 0));
        primaryStage.setScene(scene);/*www .  j  a v  a 2 s.c  o m*/
        primaryStage.show();
    }

From source file:com.github.drbookings.ui.controller.UpcomingController.java

private static void addCheckInNotes(final LocalDate date, final VBox box,
        final List<CheckInOutDetails> checkInNotes) {

    if (checkInNotes.size() > 0) {
        for (final CheckInOutDetails next : checkInNotes) {
            final TextFlow tf = new TextFlow();
            final Text t0 = new Text("Room " + next.room);
            t0.getStyleClass().add("emphasis");
            final Text t1 = new Text(" (" + next.bookingOrigin + ")");
            tf.getChildren().addAll(t0, t1);
            if (!StringUtils.isBlank(next.notes)) {
                final Text t2 = new Text(": " + next.notes);
                t2.getStyleClass().add("guest-message");
                tf.getChildren().add(t2);
            }//from  w w  w.ja  v a2 s .c o m
            box.getChildren().add(tf);
        }
        box.getChildren().add(new Separator());
    }
}