Darano

Main.java

Oct 15th, 2018
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.67 KB | None | 0 0
  1. import javafx.application.Application;
  2. import javafx.scene.Group;
  3. import javafx.scene.Scene;
  4. import javafx.scene.shape.Rectangle;
  5. import javafx.stage.Stage;
  6. import java.util.ArrayList;
  7.  
  8. public class Main extends Application {
  9.     @Override
  10.     public void start(Stage primaryStage) {
  11.         ArrayList<CreateRect> rects = new ArrayList<>();
  12.         Group root = new Group();
  13.         Scene scene = new Scene(root, 300, 250);
  14.  
  15.         CreateRect rectangle = new CreateRect(50, 50, 200, 100);
  16.         rects.add(rectangle);
  17.  
  18.         for (Rectangle rect : rects) {
  19.             root.getChildren().add(rect);
  20.         }
  21.         primaryStage.setScene(scene);
  22.         primaryStage.show();
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment