Using QuadCurveToBuilder
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.shape.MoveTo;
import javafx.scene.shape.Path;
import javafx.scene.shape.QuadCurveToBuilder;
import javafx.stage.Stage;
public class Main extends Application {
public static void main(String[] args) {
Application.launch(args);
}
@Override
public void start(Stage primaryStage) {
Group group = new Group();
Path spade = new Path();
spade.getElements().add(new MoveTo(25.0f, 0.0f));
spade.getElements().add(QuadCurveToBuilder.create()
.controlX(40.0f)
.controlY(50.0f)
.x(27.0f)
.y(30.0f)
.build());
group.getChildren().add(spade);
Scene scene = new Scene(group, 300, 200);
primaryStage.setScene(scene);
primaryStage.show();
}
}
Related examples in the same category