import javafx.application.Application; import javafx.stage.Stage; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.layout.GridPane; import javafx.scene.layout.Pane; import javafx.scene.paint.Color; import javafx.scene.shape.Circle; import javafx.scene.shape.Rectangle; import javafx.scene.text.Text; public class TusenKnapper extends Application { @Override public void start(Stage stage) { GridPane pane = new GridPane(); fyllGridpaneMed1000Sirkler(pane); Scene scene = new Scene(pane, 400, 300); stage.setTitle("Velkommen til Java FX"); stage.setFullScreen(true); stage.setScene(scene); stage.show(); } public static void main(String[] args) { Application.launch(args); } private static void fyllGridpaneMed1000Sirkler(GridPane pane) { for (int kol = 0; kol < 50; kol++) { for (int rad = 0; rad < 20; rad++) { Button btn = new Button(); btn.setStyle("-fx-background-color: #000000"); pane.add(btn, rad, kol); } } } }