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

/**
 * Creates a popup containing error without any pretty things for a graphical way to show errors
 * @param error Error string to show//from   ww  w . j a  va 2s  . c  o m
 */
public static void showError(String error) {
    if (Platform.isFxApplicationThread()) {
        Stage s = new Stage();
        VBox v = new VBox();
        v.getChildren().add(new Label("Error [" + error + ']'));
        Scene sc = new Scene(v);
        s.setTitle("Fail");
        s.setScene(sc);
        s.show();
    } else {
        Platform.runLater(() -> {
            Stage s = new Stage();
            VBox v = new VBox();
            v.getChildren().add(new Label("Error [" + error + ']'));
            Scene sc = new Scene(v);
            s.setTitle("Fail");
            s.setScene(sc);
            s.show();
        });
    }
}

From source file:Main.java

private static VBox createVBox(final double spacing, final Node... children) {
    final VBox vbox = new VBox(spacing);
    vbox.getChildren().addAll(children);
    return vbox;// w w  w. j  av a2 s. c  om
}

From source file:gov.va.isaac.gui.util.ErrorMarkerUtils.java

/**
 * Useful when taking a node already placed by a fxml file, for example, and wrapping it
 * in a stack pane//from  ww w . j  av a 2 s  .  c o m
 * WARNING - the mechanism of moving the properties isn't currently very smart - it should only target
 * VBox properties, but it takes everything.
 * @return replacementNode
 */
public static StackPane swapVBoxComponents(Node placedNode, StackPane replacementNode, VBox vb) {
    int index = vb.getChildren().indexOf(placedNode);
    if (index < 0) {
        throw new RuntimeException("Placed Node is not in the vbox");
    }

    vb.getChildren().remove(index);
    vb.getChildren().add(index, replacementNode);

    //this transfers the node specific constraints
    replacementNode.getProperties().putAll(placedNode.getProperties());
    return replacementNode;
}

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

private static void addGeneralSummary(final LocalDate date, final VBox box,
        final List<CheckInOutDetails> checkInNotes) {
    final Text t0 = new Text(getDateString(date));
    final Text t1 = new Text(", there " + (checkInNotes.size() > 1 ? " are " : "is "));
    t0.getStyleClass().add("emphasis");
    final TextFlow tf = new TextFlow();
    tf.getChildren().addAll(t0, t1);//from ww w.ja v a2s .  c  om
    box.getChildren().add(tf);
}

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

private static void addCleanings(final LocalDate date, final VBox box,
        final Collection<CleaningEntry> upcomingBookings) {

    for (final CleaningEntry c : upcomingBookings) {
        final TextFlow tf = new TextFlow();
        final Text t0 = new Text("Room " + c.getRoom() + ": ");
        t0.getStyleClass().add("emphasis");
        final Text t1 = new Text(c.getName());
        tf.getChildren().addAll(t0, t1);
        box.getChildren().add(tf);
    }/*  ww  w.j  av  a  2 s.c  o m*/

}

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

private static void addCleaningSummary(final LocalDate date, final VBox box,
        final Collection<CleaningEntry> upcomingBookings) {
    final TextFlow tf = new TextFlow();
    if (upcomingBookings.isEmpty()) {
        // final Text t0 = new Text("and no cleaning.");
        // tf.getChildren().add(t0);
    } else {/*from  w w  w .  jav a  2 s  .c o m*/
        final Text t0 = new Text("and ");
        final Text t1 = new Text(upcomingBookings.size() + " ");
        t1.getStyleClass().add("emphasis");
        final Text t2 = new Text(" cleaning" + (upcomingBookings.size() > 1 ? "s." : "."));
        t2.getStyleClass().add("emphasis");
        tf.getChildren().addAll(t0, t1, t2);
    }
    box.getChildren().add(tf);

}

From source file:Main.java

@Override
public void start(Stage stage) {
    Text msg = new Text("Hello JavaFX");
    VBox root = new VBox();
    root.getChildren().add(msg);

    Scene scene = new Scene(root, 300, 50);
    stage.setScene(scene);/*from  w w  w  .ja v  a  2  s.co  m*/
    stage.setTitle("Hello JavaFX Application with a Scene");
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Text text = new Text("!");
    text.setFont(new Font(40));
    VBox box = new VBox();
    box.getChildren().add(text);
    final Scene scene = new Scene(box, 300, 250);
    scene.setFill(null);/*w w w. ja v  a2  s. c  o  m*/
    stage.setScene(scene);
    stage.show();
    stage.close();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    ChoiceBox choiceBox = new ChoiceBox();

    VBox box = new VBox();
    box.getChildren().add(choiceBox);
    final Scene scene = new Scene(box, 300, 250);
    scene.setFill(null);/*from w  w w .j av  a  2 s.  c o  m*/
    stage.setScene(scene);
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Text text = new Text("!");
    text.setFont(new Font(40));
    VBox box = new VBox();
    box.getChildren().add(text);
    final Scene scene = new Scene(box, 300, 250);
    scene.setFill(null);//from   w ww . j  a  va2s  . com
    stage.setScene(scene);
    stage.show();
    stage.toFront();
}