/* * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. */ import java.util.Random; import javafx.application.Application; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.effect.Blend; import javafx.scene.effect.Bloom; import javafx.scene.effect.BoxBlur; import javafx.scene.effect.DropShadow; import javafx.scene.effect.Lighting; import javafx.scene.shape.Rectangle; import javafx.stage.Screen; import javafx.stage.Stage; /** * * @author Alexander Kouznetsov */ public class Bug extends Application { public static void main(String[] args) { launch(args); } @Override public void start(Stage stage) throws Exception { Group group2 = new Group(); for (int j = 0; j < 100; j++) { Group group = new Group(); Random random = new Random(); for (int i = 0; i < 100; i++) { Rectangle r = new Rectangle(); // r.setFill(Color.GREEN); // r.setStroke(Color.RED); r.setStyle("-fx-fill: green; -fx-stroke: red;"); r.setWidth(100); r.setHeight(100); r.setX(random.nextDouble() * (Screen.getPrimary().getBounds().getWidth() - 100)); r.setY(random.nextDouble() * (Screen.getPrimary().getBounds().getHeight() - 100)); group.getChildren().add(r); } group.setScaleX(random.nextDouble() * (100 - j) * 10); group.setScaleY(random.nextDouble() * (100 - j) * 10); group.setEffect(new Lighting()); group2.getChildren().add(group); } group2.setEffect(new DropShadow()); Scene scene = new Scene(group2); stage.setScene(scene); stage.show(); } }