import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
import javafx.scene.shape.Shape;
import javafx.stage.Stage;
public class ShapeTest extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) {
Circle circle1 = new Circle(50, 50, 50);
circle1.setFill(Color.RED);
// Circle circle2 = new Circle(70, 50, 50);
Circle circle2 = new Circle(200, 50, 50);
circle2.setFill(Color.BLUE);
// Shape 可以做图形形状的加减和取重,得到的新图形默认黑色
Shape shape = Shape.union(circle1, circle2);
Group group = new Group();
group.getChildren().add(shape);
// group.getChildren().addAll(circle1, circle2);
primaryStage.setScene(new Scene(group));
primaryStage.show();
}
}