You are on page 1of 2

import

import
import
import
import
import
import

javafx.application.Application;
javafx.scene.Scene;
javafx.scene.layout.Pane;
javafx.scene.paint.Color;
javafx.scene.shape.Circle;
javafx.scene.shape.Polygon;
javafx.stage.Stage;;

public class BorundiROMERO extends Application{


@Override
public void start(Stage primaryStage) {
// TODO Auto-generated method stub
Polygon arr[] = new Polygon [4];
Circle circle = new Circle();
Polygon star[] = new Polygon[3];
circle.setRadius(100.0);
circle.setFill(Color.WHITE);
circle.setStroke(Color.WHITE);
for (int i = 0; i < arr.length; i++){
arr[i]=new Polygon();
arr[i].setFill(Color.GREEN);
if (i<2){
arr[i].getPoints().addAll(new Double[]{0.0,20.0,
360.0,200.0,
0.0,380.0});
}
else {arr[i].getPoints().addAll(new Double[]{30.0,0.0,
690.0,0.0,
360.0,160.0});
arr[i].setFill(Color.RED);
}
}
for (int i = 0; i < star.length; i++) {
star[i]=new Polygon();
star[i].getPoints().addAll(new Double[]{20.0,20.0,
30.0,20.0,
35.0,10.0,
40.0,20.0,
50.0,20.0,
45.0,30.0,
50.0,40.0,
40.0,40.0,
35.0,50.0,
30.0,40.0,

20.0,40.0,
25.0,30.0});
star[i].setStroke(Color.GREEN);
star[i].setFill(Color.RED);
star[i].strokeWidthProperty().set(2);
}
Pane pane = new Pane();
pane.getChildren().addAll(arr);
arr[1].setRotate(180);
arr[1].translateXProperty().setValue(370);
arr[3].setRotate(180);
arr[3].translateYProperty().setValue(250);
pane.getChildren().addAll(circle);
pane.getChildren().addAll(star);
circle.setCenterX(360);
circle.setCenterY(200);
star[0].relocate(344, 130);
star[1].relocate(300, 200);
star[2].relocate(388, 200);
Scene scene = new Scene(pane,720,400);
primaryStage.setTitle("BURUNDI FLAG");
primaryStage.setScene(scene);
primaryStage.show();
primaryStage.setResizable(false);
}
public static void main(String[] args) {
// TODO Auto-generated method stub
Application.launch(args);
}
}

You might also like