Example usage for javafx.scene Group getChildren

List of usage examples for javafx.scene Group getChildren

Introduction

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

Prototype

@Override
public ObservableList<Node> getChildren() 

Source Link

Document

Gets the list of children of this Group .

Usage

From source file:Main.java

@Override
public void start(Stage stage) {
    Group root = new Group();
    Scene scene = new Scene(root, 600, 400);
    stage.setScene(scene);//from   w w w.j  a  va2 s .c  o m
    stage.setTitle("Slider Sample");

    Slider slider = new Slider(0, 1, 0.5);
    root.getChildren().add(slider);

    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Group root = new Group();
    Scene scene = new Scene(root, 500, 200);
    stage.setScene(scene);// w w w .j av a  2 s . com

    ScrollBar s1 = new ScrollBar();
    s1.setOrientation(Orientation.VERTICAL);

    root.getChildren().add(s1);
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    Group root = new Group();
    Scene scene = new Scene(root, 551, 400, Color.BLACK);
    Group buttonGroup = new Group();
    Arc rightButton = ArcBuilder.create().type(ArcType.ROUND).radiusX(15).radiusY(15).startAngle(180 - 30)
            .length(60).translateX(40).build();
    buttonGroup.getChildren().add(rightButton);
    buttonGroup.translateYProperty().bind(scene.heightProperty().subtract(10));
    root.getChildren().add(buttonGroup);

    primaryStage.setScene(scene);/*w ww . j a  v  a 2 s.c o m*/
    primaryStage.show();
}

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    primaryStage.setTitle("Text Fonts");

    Group g = new Group();
    Scene scene = new Scene(g, 550, 250, Color.web("0x0000FF", 1.0));

    final Rectangle rect = RectangleBuilder.create().x(100).y(100).width(50).height(50).build();

    g.getChildren().add(rect);

    primaryStage.setScene(scene);/*from ww  w .ja v  a 2  s .c  o m*/
    primaryStage.show();
}

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    primaryStage.setTitle("Text Fonts");

    Group g = new Group();
    Scene scene = new Scene(g, 550, 250, Color.web("0x0000FF", 1.0));

    final Text text1 = TextBuilder.create().text("Hello World!").x(50).y(50).fill(Color.WHITE).build();

    g.getChildren().add(text1);

    primaryStage.setScene(scene);/*from   w ww  . j  a  v  a  2  s .co  m*/
    primaryStage.show();
}

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    Group group = new Group();

    Rectangle rect = new Rectangle(20, 20, 200, 200);

    StrokeTransition sT = new StrokeTransition(Duration.millis(2000), rect, Color.LIME, Color.YELLOW);
    sT.play();//from w w w. j  a va2  s. c o  m

    group.getChildren().add(rect);

    Scene scene = new Scene(group, 300, 200);
    primaryStage.setScene(scene);
    primaryStage.show();
}

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    Group root = new Group();
    Scene scene = new Scene(root, 551, 400);
    Group buttonGroup = new Group();
    Rectangle buttonArea = RectangleBuilder.create().arcWidth(15).arcHeight(20).fill(new Color(0, 0, 0, .55))
            .x(0).y(0).width(60).height(30).stroke(Color.BLACK).build();
    buttonGroup.getChildren().add(buttonArea);
    root.getChildren().add(buttonGroup);

    primaryStage.setScene(scene);//  w  w w .  ja  v a  2 s  .  c o m
    primaryStage.show();
}

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    primaryStage.setTitle("");
    Group root = new Group();
    Scene scene = new Scene(root, 300, 250, Color.WHITE);

    Rectangle r = new Rectangle();
    r.setX(50);//from  w w  w  .j a  va 2  s. c  o  m
    r.setY(50);
    r.setWidth(200);
    r.setHeight(100);

    root.getChildren().add(r);
    primaryStage.setScene(scene);
    primaryStage.show();
}

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    primaryStage.setTitle("Text Fonts");

    Group rectangleGroup = new Group();
    Scene scene = new Scene(rectangleGroup, 550, 250);

    Rectangle rect = new Rectangle();
    rect.setWidth(100);//  w  w  w  . j  a v  a  2  s  .  co  m
    rect.setHeight(100);

    rect.setScaleY(2);
    rectangleGroup.getChildren().add(rect);

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

From source file:Main.java

@Override
public void start(Stage stage) {
    Group root = new Group();
    Scene scene = new Scene(root, 300, 150);
    stage.setScene(scene);/*from  ww w.ja v a2 s  .  c o m*/
    stage.setTitle("Sample");

    Text t = new Text(10, 50, "This is a test");
    t.setFont(new Font(20));

    root.getChildren().add(t);

    stage.show();
}