Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javafx.application.Application;
- import javafx.scene.Group;
- import javafx.scene.Scene;
- import javafx.scene.shape.Rectangle;
- import javafx.stage.Stage;
- import java.util.ArrayList;
- public class Main extends Application {
- @Override
- public void start(Stage primaryStage) {
- ArrayList<CreateRect> rects = new ArrayList<>();
- Group root = new Group();
- Scene scene = new Scene(root, 300, 250);
- CreateRect rectangle = new CreateRect(50, 50, 200, 100);
- rects.add(rectangle);
- for (Rectangle rect : rects) {
- root.getChildren().add(rect);
- }
- primaryStage.setScene(scene);
- primaryStage.show();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment