package fx01;
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
import javafx.scene.shape.*;
import javafx.scene.text.Text;
import javafx.scene.paint.Color;
public class pro extends Application {
int s;
Line lx=new Line[50];
public static void main(String args) {
launch(args);
}
@Override
public void start(Stage primaryStage) {
for(s=1;s<50;s++){
lx[s]=new Line(10*s,10*s,10*s+10,10*s+10);
lx[s].setStroke(Color.RED);
}
Text t = new Text(100,100,"風");
Group root = new Group();
Scene scene = new Scene(root, 700, 700);
root.getChildren().add(t);
for(s=1;s<50;s++){
root.getChildren().add(lx[s]);
}
Double[] z=new Double[6];
z[0]=0.0;
z[1]=0.0;
z[2]=150.0;
z[3]=100.0;
z[4]=100.0;
z[5]=150.0;
Polygon poly = new Polygon();
poly.getPoints().addAll(z);
root.getChildren().add(poly);
primaryStage.setTitle("練習");
primaryStage.setScene(scene);
primaryStage.show();
}
}