Example usage for javafx.scene.shape Rectangle setLayoutX

List of usage examples for javafx.scene.shape Rectangle setLayoutX

Introduction

In this page you can find the example usage for javafx.scene.shape Rectangle setLayoutX.

Prototype

public final void setLayoutX(double value) 

Source Link

Usage

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);/*from w  ww.  j av  a 2  s .  c o  m*/

    Rectangle rect = new Rectangle(100, 100);
    rect.setLayoutX(50);
    rect.setLayoutY(50);
    rect.setStyle("-fx-fill: red; ");
    ((Group) scene.getRoot()).getChildren().add(rect);

    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  a2  s.c  om

    Rectangle rect = new Rectangle(100, 100);
    rect.setLayoutX(50);
    rect.setLayoutY(50);
    rect.getStrokeDashArray().addAll(1.0, 13.0);
    ((Group) scene.getRoot()).getChildren().add(rect);

    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  a v  a2  s . com

    Rectangle rect = new Rectangle(100, 100);
    rect.setLayoutX(50);
    rect.setLayoutY(50);
    rect.setStrokeLineCap(StrokeLineCap.BUTT);
    ((Group) scene.getRoot()).getChildren().add(rect);

    stage.show();

}