JavaFX QuadCurve class

Description

JavaFX QuadCurve class

import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.scene.shape.QuadCurve;
import javafx.stage.Stage;

public class Main extends Application {

    public static void main(String[] args) {
        Application.launch(args);// ww  w .  j a  v  a 2 s  .c  om
    }
    
    @Override
    public void start(Stage primaryStage) {
        primaryStage.setTitle("java2s.com");
        Group root = new Group();
        Scene scene = new Scene(root, 300, 250, Color.WHITE);

        QuadCurve quad = new QuadCurve();
        quad.setStartX(50);
        quad.setStartY(50);
        quad.setEndX(150);
        quad.setEndY(50);
        quad.setControlX(125);
        quad.setControlY(150);
        quad.setStrokeWidth(3);
        quad.setStroke(Color.BLACK);
        quad.setFill(Color.WHITE);

        root.getChildren().add(quad);

        primaryStage.setScene(scene);
        
        primaryStage.show();
    }
}



PreviousNext

Related