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]);
}
Polygon poly = new Polygon();
poly.getPoints().addAll(new Double[]{0.0, 0.0,200.0, 100.0,100.0, 200.0});
root.getChildren().add(poly);
primaryStage.setTitle("練習");
primaryStage.setScene(scene);
primaryStage.show();
}
}