Java ArcBuilder.centerY(double x)

Syntax

ArcBuilder.centerY(double x) has the following syntax.

public B centerY(double x)

Example

In the following code shows how to use ArcBuilder.centerY(double x) method.


import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.scene.shape.Arc;
import javafx.scene.shape.ArcBuilder;
import javafx.scene.shape.ArcType;
import javafx.stage.Stage;
//from w w w.  ja v a2  s  . co m
public class Main extends Application {

    public static void main(String[] args) {
        Application.launch(args);
    }

    @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)
                .centerX(12)
                .centerY(16)
                .radiusX(15)
                .radiusY(15)
                .startAngle(180-30)
                .length(60)
                .fill(new Color(1,1,1, .90))
                .translateX(40)
                .build();
        buttonGroup.getChildren().add(rightButton);
        root.getChildren().add(buttonGroup);
        
        primaryStage.setScene(scene);
        primaryStage.show();
    }
}




















Home »
  Java Tutorial »
    javafx.scene.shape »




Arc
ArcBuilder
Circle
Ellipse
Line
Polygon
VLineTo