/* * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. */ package tests; import java.net.URL; import java.util.logging.Level; import java.util.logging.Logger; import javafx.application.Application; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.layout.GridPane; import javafx.stage.Stage; /** * * @author jcambon */ public class TestInspector extends Application { @FXML private GridPane propertiesSection; @FXML private GridPane layoutSection; /** * @param args the command line arguments */ public static void main(String[] args) { Application.launch(TestInspector.class, (java.lang.String[]) null); } @Override public void start(Stage primaryStage) { try { final FXMLLoader loader = new FXMLLoader(); URL fxmlURL = TestInspector.class.getResource("Inspector_test2.fxml"); loader.setController(this); loader.setLocation(fxmlURL); Parent page = (Parent) loader.load(); Scene scene = new Scene(page); primaryStage.setScene(scene); primaryStage.setTitle("test FXML"); primaryStage.show(); } catch (Exception ex) { Logger.getLogger(TestInspector.class.getName()).log(Level.SEVERE, null, ex); } } @FXML void addContent(ActionEvent event) { for (int ii = 0; ii < 10; ii++) { propertiesSection.add(new Button("Button " + ii), 0, ii); layoutSection.add(new Button("Button " + ii), 0, ii); } } }