JavaFX Tutorial - Java Circle.centerYProperty()








Syntax

Circle.centerYProperty() has the following syntax.

public final DoubleProperty centerYProperty()

Example

In the following code shows how to use Circle.centerYProperty() method.

import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
import javafx.stage.Stage;
/*  w ww  .  j av a2s .  c om*/
public class Main extends Application {

    public static void main(String[] args) {
        Application.launch(args);
    }
    
    @Override
    public void start(Stage primaryStage) {
        primaryStage.setTitle("Title");
        
        final Circle circ = new Circle(40,Color.RED);
        
        System.out.println(circ.centerYProperty().doubleValue());
        
        final Group root = new Group(circ);
        final Scene scene = new Scene(root, 400, 300);        
              
        primaryStage.setScene(scene);
        primaryStage.show();
    }
}