List of usage examples for javafx.scene.shape Circle relocate
public void relocate(double x, double y)
From source file:Main.java
@Override public void start(Stage stage) { Group root = new Group(); Scene scene = new Scene(root, 260, 80); stage.setScene(scene);// ww w.ja va2 s. c o m stage.setTitle(""); VBox vb = new VBox(); Pane canvas = new Pane(); canvas.setStyle("-fx-background-color: black;"); canvas.setPrefSize(200, 200); Circle circle = new Circle(50, Color.BLUE); circle.relocate(20, 20); Rectangle rectangle = new Rectangle(100, 100, Color.RED); rectangle.relocate(70, 70); canvas.getChildren().addAll(circle, rectangle); vb.getChildren().add(canvas); scene.setRoot(vb); stage.show(); }