import javafx.application.Application; import javafx.stage.Stage; import javafx.scene.Scene; import javafx.scene.Group; import javafx.scene.canvas.Canvas; import javafx.scene.canvas.GraphicsContext; public class Complexshapes extends Application { public void start(Stage stage) { Canvas canvas = new Canvas(300, 150); GraphicsContext ctx = canvas.getGraphicsContext2D(); // Since the canvas has no subpaths, a virtual moveTo must be performed to (65,25) before creating the bezier. ctx.bezierCurveTo(65, 25, 65, 25, 65, 65); ctx.stroke(); ctx.beginPath(); // Since the canvas has no subpaths, a virtual moveTo must be performed to (35,25) before creating the bezier. ctx.bezierCurveTo(35, 25, 35, 25, 35, 65); ctx.stroke(); ctx.beginPath(); // Since the canvas has no subpaths, a virtual moveTo must be performed to (0,75) before creating the bezier. ctx.bezierCurveTo(0, 75, 50, 150, 100, 75); ctx.stroke(); stage.setScene(new Scene(new Group(canvas))); stage.show(); } }